-
Notifications
You must be signed in to change notification settings - Fork 2
Description
#9 added basic support for Microsoft's language server protocol, and integration with Emacs and VS Code. However, there's a lot of improvements which could be made:
Features
-
Code folding: Aside from the obvious indentation/structrual folding, we should allow folding multi-line doc comments into a single one. Ideally we'd also identifiy multiple
local x = require(y)statements and allow folding them together. -
Refactoring/code fixes: Effectively we want a similar scheme to linters, just without detailed messages and tags. Some basic things we might like:
- Invert
if/elsestatement. - Convert between quote styles (single, double, long-style).
- Convert between number formats (decimal <-> hex).
- Invert
-
Renaming: This should be conceptually quite simple - just generate an edit which updates all names. We need to be careful that we don't introduce a conflict though - possibly worth seeing what additional info the resolver needs to handle this efficiently.
-
Document outline: I'm not entirely sure how we want to do this yet - we obviously don't want to document every local, but still need to give a decent overview of the layout.
-
Workspace symbols: It should be sufficient just to load all modules and dump the entire symbol tree.
-
Completion: This is an obvious choice, but I have no clue where to even begin on this.
-
Handle references in doc comments: We should be able to use go-to-definition, see usages and have symbol highlights for references within doc comments.
Performance
- Check for memory leaks: It might be possible to do some automated detection of this too. For instance, run a specific task (open/close a file) many times and compare memory usage over time.
- Use LSP's file watching support
Editors
- Download the language server: On compatible platforms, we should download the language server automatically. Possibly worth looking into periodic updates too.