Replies: 1 comment 1 reply
-
|
So, on release/v1.0.9 source commands should apply to workspaces. Still definitely needs more testing though... There are a couple of minor bugs like the server sending A code review on the workspace handler would be greatly appreciated. Will try to find some time early next week to work on finalizing the changes mentioned here into a PR. Also, these changes will allow you to jump around to different Other notes about recent changes include:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
releasing v1.0.9 feat.separating-symbol-parsing
Hello there!
I've been working on cleaning up the code base here, and improving the
maintainability of this project for a while now. Most of my work has been
documented in the history of the branch, feat.separating-symbol-parsing.
Apologies for the large amount of changes in this branch. This branch should be
a pretty stable experience in its current state, and will continue improving
until it is merged. Feel free to fork the repo and set up a local development
branch that tracks this branch, if you are interested in contributing directly
to it.
Contributions to master are also welcome. However, if you are attempting to
work on a feature mentioned below, you will likely need some of the newer
features to successfully implement them.
Below are some of the things I've been working toward finishing in this branch.
Any help, ideas, or feedback would be greatly appreciated.
General Improvements
Startup speed time has increased
Parsing out nodes that are a definition are significantly easier to work with.
Over the history of this project, finding where functions or variables are
defined was a bit janky and required lots of testing to work with.
Since
tree-sitter-fishdoesn't include token definitions for the nodes we areinterested in, we have to rely on the context around a
SyntaxNodetodetermine it's type.
The newer
src/parsing/*.tsfiles allow us to keep the previous logic we usedto determine if a SyntaxNode was a definition by primarily looking up through its parent nodes,
while also only moving down the tree to only focus nodes that are the
node.typeornode.firstNamedChild.textfor commands that we specify.We also try to define what possible flags can be seen on in each command that we process
(see
SetOptions). This allows us to define shape of a command.Lastly, we still export the
isVariableDefinitionName,isAliasDefinitionName,and
isFunctionDefinitionNamefrom thesrc/parsing/*.tsfiles, and theagain from the
src/utils/node-types.tsfiles, so that we can import allnode-types from the same location.
Documentation included on
FishSymbolitems are improved, and Hover resultsinclude more information. This is primarily done by the
src/snippets/*.jsonfiles.Autoloaded environment variables are now sourced during the server's startup
process. This allows us to use the values from these variables in multiple
places throughout the server. A particularly nice example is in CodeAction's
that previously used an absolute file path in it's title, now uses the variable
corresponding to the workspace it is in to shorten the path.
Tons of files that were no longer used were removed.
This is in preparation for the eventual 1.1.0 release, where the project
structure will not need to be changed within the foreseeable future. (I hope)
TODO
Add better workspace support for non auto-loaded/small fish workspaces.
Supporting
/tmp/*.fishbuffers from things likeedit_command_buffer/alt-eSupporting
fisherworkspaces (consider a workspace like~/repo/fisher-plugin, as its own workspace without$fish_lsp_all_indexed_paths)Supporting sourced files outside of workspace, and adding them to the
workspace
implement a procedure to compare
argparsedefinition flags to completioncompleteflags that would match. Allowing our
generate completion for argparse commandcode-actions toskip already defined flags in a loaded file.
Add some more user configuration, options like:
fish_lsp_indent_commandto specify thefish_indentcommand & it's flagsfor formatting a LspDocument.
;symbols to format their code using the command:
fish_indent --only-indent.fish_indentbehavior was changed from version[email protected]to[email protected]potentially remove
fish_lsp_single_workspace_supportsince itdoesn't work as intended.
support initializationOptions
Completed
Add
$__fish_**auto-loaded environment variables to the server's startupconfiguration. An example auto-loaded variable would be
$__fish_config_direnvexports the handler to lookup between
process.envand the storedenv.envStoreobject.
env.envStoreobject is populated by the file src/utils/process-env.tswhich importantly does not store the autoloaded variables on
process.env. If wewere to store the autoloaded variables here, any child process (like the src/utils/exec.ts file)
src/utils/process-env.tsuses the names seen inautoloadedFishVariableNamesand
./fish_files/get-fish-autoloaded-paths.fish.Auto-loaded variables retrieved in these files, currently need their
keys to be in the same order in both files.
path1:path2:path3:path\ 4:path_5)in the
env.envStoreobject, and are retrieved by theenvhandler by using theenv.get()&env.getAsArray()methods.Improve parsing of specific DocumentSymbols (now
FishSymbol) by usingmore verbose rules for excluding certain tokens from
web-tree-sitterAdd go to definition and hover support for
sourcefiles.Improve the Hover outputs to add included info from
./src/snippets/*.jsonfiles,when available.
Improve the
src/utils/node-types.tsreadability by separating each kindof node we have to handle in a
web-tree-sittertree, forFishSymboldefinitions.Here we actually renamed
FishDocumentSymboltoFishSymbolacross theentire project. The major differences being how they are parsed
functions:
functionnamesaliasnodesvariables:
forstatement variablessetcommand variablesfunction _ --argument-names a b --inherit-variable cread --array a b cargparse h/help -- $argvcommands:
source filenamefilenamescomplete -c commandcommand names and optsflags/options:
--long,-s(short),-type d(unix)--field=2,-f2would be able to get both flag seen and value,-f/--fieldwould be the flag seen, and value would be2for bothset -gxwould be able to get both--globaland--exportflagsOf course, this requires that you can define the short flags before
looking them up against a
SyntaxNodein theweb-tree-sittertree.cleanup unused files, and refactor some code to improve readability
added lots more tests, and fixed test-cases that had their expected
results changed by the new features.
additions & fixes to code-actions
sourcecommand file doesn't exist is more preciseargparsecompletions inconf.d/*.fishfiles are fixed.fish --no-executeis now an experimental feature, and is disabled bydefault.
# @fish-lsp-disable NUMBERSnow warn the user.changed the install scripts to use
nodeinstead offishfor thepackage.json, scriptsh:build-timefishto run the serverRelated discussions/issues
Beta Was this translation helpful? Give feedback.
All reactions