Add Document symbols aka outline#21
Open
sergioalcaraz wants to merge 22 commits intophil294:masterfrom
Open
Conversation
- Expose findDocumentSymbols on LanguageMode - Implement JS mode mapping from TypeScript navigation tree to DocumentSymbol - Wire LSP textDocument/documentSymbol handler and capability Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Use CoffeeScript.compile(..., { ast: true }) to extract AST and build DocumentSymbol tree
- Fallback to TypeScript navigation + source maps if AST not available or parsing fails
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add coffeeAstService to build DocumentSymbol trees from CoffeeScript AST - Refactor javascript mode to call service with TypeScript fallback - Wire service into project/lsp earlier changes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add fixture and integration test for Document Symbols (outline) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Produce flat symbol list and build hierarchy by range containment - Better name extraction (id.name, key.name) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Log collected flat symbol count and root count for debugging Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Use console.log to surface counts during tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Only include classes, methods, functions and assignment-based variables in outline - Clamp selectionRange into range Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Ensure javascript mode uses CoffeeScript AST results and fallbacks - Silence logger in AST try/catch to avoid missing symbol noise Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…erals; include closures - Show object literal keys and nested functions - Include @Property assignments as class properties - Skip Null/Boolean/Number/String literal nodes to reduce noise - Synthesize names for anonymous functions (closure(params)) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… is function or object - When assignment detected, emit symbol for LHS with kind derived from RHS (Function vs Variable) - Avoid duplicate identifier/function symbols by skipping lhs/rhs nodes where assignment handled them - Keep traversing RHS so object properties and nested functions are discovered Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tion/name/category - client: include `outline` in configuration synchronization - server: read outline.sortOrder (or aliases) from env.getConfig() and sort symbols recursively before returning Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…upport for ES module import specifiers so `import x from 'y'` appears in Document Symbols.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…) in outline\n\nAdd explicit handling for CommonJS assignments so 'module.exports' and 'exports.x' appear with clear names in Document Symbols.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…\n\nAdd export default and named export symbols; refine dotted-name extraction for module.exports/exports.*.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…t default' and named exports appear in Document Symbols. Compute range from child nodes when necessary.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…s children of export default\n\nWhen export default a anonymous class/function/object, synthesize a name for the inner node so it becomes a child symbol under the 'default' export.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… structure\n\nDo not mark export declarations as seen; let inner class/function/object be collected so their members appear under the export default symbol.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nymous class/function/object\n\nVerify export default anonymous declarations expose inner structure in Document Symbols.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial outline support using the compiler-provided AST.
This presents the tree for variables, functions, classes with their methods, literal objects with their class-like structure, ES6 imports, ES6 exports, and also CommonJS.