Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Query symbol index for workspace symbols #485

Closed
jakebailey opened this issue Dec 12, 2018 · 1 comment
Closed

Query symbol index for workspace symbols #485

jakebailey opened this issue Dec 12, 2018 · 1 comment
Assignees
Milestone

Comments

@jakebailey
Copy link
Member

For #433.

@jakebailey jakebailey added this to the Dec 2018.2 milestone Dec 12, 2018
@jakebailey jakebailey self-assigned this Dec 12, 2018
@jakebailey jakebailey added the GA label Dec 17, 2018
@MikhailArkhipov MikhailArkhipov modified the milestones: Dec 2018.2, Jan 2019.1 Jan 9, 2019
jakebailey added a commit that referenced this issue Jan 16, 2019
For #433.
Closes #483.
Closes #484.
Closes #485.

General overview:
- Indexing happens on each parse, so with the current LS, every file in the workspace gets indexed. This will need to be reworked.
- All symbol queries go to the index, I have not yet approached #486.
- I do some extra heuristics to highlight some of the more interesting symbols, namely:
  - `__init__` in a `class` will be marked as a constructor.
  - Functions annotated with a property decorator are given the kind `Property`.
  - Functions that fit the pattern `__.*__` are given the kind `Operator`.
  - Other functions in a class are given the kind `Method`.
  - Variables that look like `UPPERCASE_UNDERSCORE_123` at the top level or directly inside a class are given the kind `Constant`.
- Any parse updates the index. I don't do any version management other than to look up the AST on the parse complete event.
- VS-specific "functionKind" is preserved.

Things to do in future PRs:
- Fallback to analysis when it's present. I left all of the functions previously used there.
- Using the import system to answer the question "is this thing being imported a module or not", probably augmented/modified outside the indexer.
- Parse version management.
- Asynchronous behavior (switching the dictionary to be a map from `Uri` to `TaskCompletionSource<HierarchicalSymbol>`).
@jakebailey
Copy link
Member Author

Closed by #521.

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

No branches or pull requests

2 participants