halfbrained / cuda_lsp

LSP Client plugin for CudaText
6 stars 4 forks source link

If possible, add filling of code-tree from LSP server #92

Closed Alexey-T closed 3 years ago

Alexey-T commented 3 years ago

https://github.com/Alexey-T/CudaText/issues/3369#issuecomment-841801712

Alexey-T commented 3 years ago

Wiki info on this https://wiki.lazarus.freepascal.org/CudaText_API#How_plugin_can_fill_code-tree

I don't think you can use tree-helper API here, so you need the wiki info.

Alexey-T commented 3 years ago

Tree-helper API - https://wiki.lazarus.freepascal.org/CudaText_API#TreeHelpers

halfbrained commented 3 years ago

If I understand correctly, the only problem with tree helpers that I see - I can only know: is currently running lsp-servers support this functionalty -- so I can't list supported lexers in 'install.inf'

Is there some workaround for this, or should I use code-tree directly?

Alexey-T commented 3 years ago

I don't see the workaround so you have to fill code-tree as here- https://wiki.lazarus.freepascal.org/CudaText_API#How_plugin_can_fill_code-tree

halfbrained commented 3 years ago

Well, it works:

testing

Now I would like to clarify a few things...

  1. From the item-types that server can give me, these I ignore:

    PROPERTY FIELD VARIABLE CONSTANT STRING NUMBER BOOLEAN ARRAY OBJECT KEY NULL ENUMMEMBER EVENT OPERATOR TYPEPARAMETER

    and these I put in the tree, correct?

    FILE MODULE NAMESPACE PACKAGE CLASS METHOD CONSTRUCTOR ENUM INTERFACE FUNCTION STRUCT

  2. Should this feature be enabled by default? And a global+server options to disable? Or maybe only for some lexers, like if writing cuda-lexer is too difficult?

Alexey-T commented 3 years ago

and these I put in the tree, correct?

IMO an option (per server) will be good here (comma-separated str / list of str)

Should this feature be enabled by default?

no! off by default. it gives the slowdown. option per-server will be ok.

halfbrained commented 3 years ago

Added. Off by default, and symbol kinds to show are configured via an option.

Alexey-T commented 3 years ago

Great, thanks, and readme is updated too - good.