PackageDev icon indicating copy to clipboard operation
PackageDev copied to clipboard

Helpers for symbol tests

Open FichteFoll opened this issue 4 years ago • 5 comments

Via https://github.com/sublimehq/sublime_text/issues/3154, ST can test for symbol definitions and references. While not as important as completions for scope tests, PD should provide some automation for these. Ideas include:

  • [ ] Span entire symbol region when @ is pressed on a test line/comment
  • [ ] Automatically determine which category the marked symbol belongs to
  • [ ] Supply/Open AC with symbol categories

FichteFoll avatar Mar 22 '21 16:03 FichteFoll

While we are discussing helpers for tests...


Apart from:

  • syntax tests and
  • tests for symbol definitions and references

there is furthermore the ability to run:

  • indentation tests

by adding the reindent keyword to the header line in test files.


Compare for example:

https://github.com/sublimehq/Packages/blob/master/PHP/tests/syntax_test_indentation.php

// SYNTAX TEST reindent "Packages/PHP/PHP.sublime-syntax"

...

jrappen avatar Mar 26 '21 20:03 jrappen

@jrappen What form would a helper take for a file indentation test?

michaelblyons avatar Mar 26 '21 20:03 michaelblyons

I believe no helper is required for indentation tests - just reindenting the whole file is enough to get the tests prepared, if it isn't already. :) (this is true for both reindent-unchanged and reindent-unindented)

keith-hall avatar Mar 26 '21 21:03 keith-hall

Maybe no helpers as Keith said, but instead additions to the New Syntax Definition... section in the:

Tools > Packages > Package Development > ...

menu where the new options:

  • New test for current syntax
  • New indentation tests for current syntax
  • New symbol definitions and references test for current syntax

could be enabled when having a syntax file currently opened. Same for the command palette.


Or maybe add one entry which generates all types of tests into new empty views, so the user can work off those? My gut feeling is this would make more sense. I guess leading block (s of line) comments with references on how to do each of them would help, too.

jrappen avatar Mar 26 '21 22:03 jrappen

One thing I am excited for is for the highlighting from ^ lines to stop getting stuck on @ lines. I've added some reference tests, and now clicking on a scope test below a reference test highlights the reference test line instead of the actual line of code to be tested.

michaelblyons avatar Apr 17 '21 00:04 michaelblyons