Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch children for TU from clangd #36

Closed
ghentschke opened this issue Mar 24, 2023 · 4 comments · Fixed by #54
Closed

Fetch children for TU from clangd #36

ghentschke opened this issue Mar 24, 2023 · 4 comments · Fixed by #54
Milestone

Comments

@ghentschke
Copy link
Contributor

When expanding a translation unit in the CDT Project Explorer the IScannerInfo provides information about the functions and included files:
image

These information should not be provided by the CDT internal build AST for a project which prefers the LSP based C/C++ Editor. The language server should provide these informations.

@ghentschke
Copy link
Contributor Author

The issue is here to determine how to get the AST from the LS and feed the cdt data model with the information from the LS AST.

Outcome could be an adapter between the ASt data and the cdt data model.

@ddscharfe
Copy link
Contributor

ddscharfe commented Apr 24, 2023

  • The AST can be fetched from the LS by providing a serverInterface in the org.eclipse.lsp4e.languageServer extension point. I already got this working and can provide the implementation for this
  • To provide the cdt data model TranslationUnit::parseUsingCModelBuilder() needs to be changed to use a custom model builder. This could be also achieved by providing an own AbstractCLikeLanguage where createModelBuilder() creates the model builder.
  • I think implementing the new model builder will be quiet some work, see CModelBuilder2 for reference

@ghentschke
Copy link
Contributor Author

The idea now is to provide a new content provider for the project navigator view by extending the org.eclipse.ui.navigator.navigatorContent. The content provider can reuse the mechanism used by the outline view to determine the children of the translation unit. (see org.eclipse.lsp4e.outline.content)

@ddscharfe
Copy link
Contributor

Sounds like a good approach which requires less effort than writing a new model builder.

@ghentschke ghentschke changed the title get IScannerInfo for TU from clangd Fetch children for TU from clangd Apr 25, 2023
ghentschke added a commit to ghentschke/eclipse-cdt-lsp that referenced this issue Apr 26, 2023
Uses the LSP to fetch the children of a TU in the project explorer view.
ghentschke added a commit to ghentschke/eclipse-cdt-lsp that referenced this issue Apr 26, 2023
Uses the LSP to fetch the children of a TU in the project explorer view.
ghentschke added a commit to ghentschke/eclipse-cdt-lsp that referenced this issue May 4, 2023
Uses the LSP to fetch the children of a TU in the project explorer view.
ghentschke added a commit to ghentschke/eclipse-cdt-lsp that referenced this issue May 4, 2023
Uses the LSP to fetch the children of a TU in the project explorer view.
ghentschke added a commit to ghentschke/eclipse-cdt-lsp that referenced this issue May 9, 2023
Uses the LSP to fetch the children of a TU in the project explorer view.
ghentschke added a commit to ghentschke/eclipse-cdt-lsp that referenced this issue May 9, 2023
Uses the LSP to fetch the children of a TU in the project explorer view.
ghentschke added a commit to ghentschke/eclipse-cdt-lsp that referenced this issue May 9, 2023
Uses the LSP to fetch the children of a TU in the project explorer view.
ghentschke added a commit to ghentschke/eclipse-cdt-lsp that referenced this issue May 9, 2023
Uses the LSP to fetch the children of a TU in the project explorer view.

fixes eclipse-cdt#36
ghentschke added a commit to ghentschke/eclipse-cdt-lsp that referenced this issue May 10, 2023
Uses the LSP to fetch the children of a TU in the project explorer view.

fixes eclipse-cdt#36
ghentschke added a commit to ghentschke/eclipse-cdt-lsp that referenced this issue May 10, 2023
Uses the LSP to fetch the children of a TU in the project explorer view.

fixes eclipse-cdt#36
ghentschke added a commit to ghentschke/eclipse-cdt-lsp that referenced this issue May 10, 2023
Uses the LSP to fetch the children of a TU in the project explorer view.

fixes eclipse-cdt#36
ghentschke added a commit that referenced this issue May 10, 2023
Uses the LSP to fetch the children of a TU in the project explorer view.

fixes #36
@jonahgraham jonahgraham added this to the 1.0.0 milestone Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants