Git Product home page Git Product logo

Comments (6)

neowit avatar neowit commented on July 17, 2024

Thank you for the the suggestion.
Not sure I understood it properly though. If sublime text already does this out of the box why would you want tooling-force.com to do the same ?
Sublime is not alone - in vim tagbar plugin does the same
mock_cls____eclipse_workspace_sforce_-_sfdc_experiments_sforce__apexmock__src_classes__-_vim2

I am sure I did not understand you properly, so if you could elaborate that would be helpful.

from tooling-force.com.

ChuckJonas avatar ChuckJonas commented on July 17, 2024

I just used sublime text as an example. I'm trying to bring feature parity to vscode. Unlike sublime & vim, you must explicitly provide the symbols for vscode.

There are two interfaces to do so: WorkspaceSymbolProvider & DocumentSymbolProvider.

While symbols for the entire workspace would be nice, I think the DocumentSymbolProvider is more useful and likely easier to implement.

Example command would be something like this:

--action="listSymbols" --currentFilePath="/path/to/file.cls" --currentFileContentPath="/path/to/tmp.cls" --responseFilePath="path/to/response"

Output:

RESULT=SUCCESS
[
{'identify':'Foo', 'type':'class', 'line': 1},
{'identify':'Foo', 'type':'constructor', 'line': 3},
{'identify':'myProp', 'type':'property', 'line': 5},
{'identify':'doSomething', 'type':'method', 'line': 7},
{'identify':'InnerFoo', 'type':'class', 'line': 15}
]

Obviously output doesn't need to be exactly like that, but you get the idea.

Let me know if there is anything I can do to help make this happen!

from tooling-force.com.

neowit avatar neowit commented on July 17, 2024

Thank you for clarifying.

I like the idea. Thanks for the suggestion. Will look into this when I get a chance.

While symbols for the entire workspace would be nice, I think the DocumentSymbolProvider is more useful and likely easier to implement.

Result file size (for entire workspace) may be quite noticeable and generating/parsing it may add extra delay.

This does not seem to be a useful feature for CI scenarios so listSymbols this could be first step to adding support for LSP. My only issue with that is (not being a VSCode user myself) I am not sure what communication channel VSCode actually uses.
If we were to implement listSymbols we could just as well make it as easy to use from clients (like VSCode) supporting LSP as possible. It may even become useful in vim later, when its LSP plugin matures enough.

Do you know much about how VSCode communicate with servers supporting LSP ?

from tooling-force.com.

ChuckJonas avatar ChuckJonas commented on July 17, 2024

I've gone through the vscode language server "Hello world" in typescript but that's about it. Most of the inner workings is abstracted away because vscode provides library support for pretty much everything.

However, Here is a LSP implementation in java (& for java) and it's corresponding vscode extension.

from tooling-force.com.

ChuckJonas avatar ChuckJonas commented on July 17, 2024

Also, here is better API Documentation for the DocucumentSymbolProvider

from tooling-force.com.

neowit avatar neowit commented on July 17, 2024

thanks for the links, this is helpful.

from tooling-force.com.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.