sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
814 stars 40 forks source link

Syntax Test Results Output suggestions #6500

Open deathaxe opened 1 month ago

deathaxe commented 1 month ago

Problem description

Just some feedback after some hours of working with new syntax tests of ST4181+.

  1. The output view should be read-only.

  2. Maybe some more settings from "Widget.sublime-settings" should be specified to ensure a certain look and behavior under all circumstances.

    _I certainly stumbled over draw_white_space as my custom settings caused unwanted dots in pseudo-gutter. Maybe a question of taste though._

    Maybe, "fold_style": "auto" should be enforced to ensure syntax based folding always applies.

  3. Maybe a dedicated Syntax Test Results.sublime-menu (or Syntax Test Results Context.sublime-menu) could be applied with only required entries, inspired by Widgets Context.sublime-menu. Most of normal context menu entries just don't make sense in context of syntax test results output, IMHO.

Preferred solution

Changes to Packages/Default/run_syntax_tests.py

Adds most settings from "Widget.sublime-settings" to add some (hopefully) safe defaults.

--- Default\run_syntax_tests.py Sun Sep 29 10:31:55 2024
+++ Default\run_syntax_tests.py Sun Sep 29 10:32:14 2024
@@ -22,10 +22,24 @@
         settings = self.output_view.settings()
         settings.set('result_file_regex', PACKAGES_FILE_REGEX)
         settings.set('result_base_dir', sublime.packages_path())
+        settings.set('auto_complete', False)
+        settings.set('auto_indent', False)
+        settings.set('auto_match_enabled', False)
+        settings.set('context_menu', 'Syntax Test Results.sublime-menu')
+        settings.set('detect_indentation', False)
+        settings.set('draw_centered', False)
+        settings.set('draw_indent_guides', False)
+        settings.set('draw_white_space', 'none')
+        settings.set('fold_style', 'auto')
+        settings.set('gutter', False)
+        settings.set('line_numbers', False)
+        settings.set('match_selection', False)
+        settings.set('mini_diff', False)
+        settings.set('rulers', [])
+        settings.set('scroll_past_end', False)
+        settings.set('smart_indent', False)
+        settings.set('translate_tabs_to_spaces', False)
         settings.set('word_wrap', True)
-        settings.set('line_numbers', False)
-        settings.set('gutter', False)
-        settings.set('scroll_past_end', False)
         settings.set('syntax', syntax)

         # Call create_output_panel a second time after assigning the above
@@ -86,6 +100,8 @@

         append(self.output_view, message.format(*params))
         append(self.output_view, '[Finished]')
+
+        self.output_view.set_read_only(True)

     def in_dir(self, folder, path):
         if not folder.endswith(os.sep):

Context Menu

Packages/Default/Syntax Test Results.sublime-menu

[
    { "command": "open_context_url" },
    { "caption": "-" },
    { "command": "next_result" },
    { "command": "prev_result" },
    { "caption": "-" },
    { "command": "cut" },
    { "command": "copy" },
    { "command": "paste" },
    { "caption": "-" },
    { "command": "select_all" }
]

Alternatives

?

Additional Information

No response