Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helpers for symbol tests #342

Open
3 tasks
FichteFoll opened this issue Mar 22, 2021 · 5 comments
Open
3 tasks

Helpers for symbol tests #342

FichteFoll opened this issue Mar 22, 2021 · 5 comments

Comments

@FichteFoll
Copy link
Member

FichteFoll commented Mar 22, 2021

Via sublimehq/sublime_text#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
@jrappen
Copy link
Contributor

jrappen commented Mar 26, 2021

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"

...

@michaelblyons
Copy link

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

@keith-hall
Copy link
Member

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)

@jrappen
Copy link
Contributor

jrappen commented Mar 26, 2021

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.

@michaelblyons
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants