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

How can I add bazel support? #1825

Closed
dbushenko opened this issue Mar 4, 2021 · 1 comment · Fixed by #1845
Closed

How can I add bazel support? #1825

dbushenko opened this issue Mar 4, 2021 · 1 comment · Fixed by #1845

Comments

@dbushenko
Copy link

Hello,

I'm trying to add bazel support to vascode-java using the lsp server. Unfortunately some hardcode in vscode-java prevents me from doing this. For instance, in standardLanguageClient.ts there is a function:

function isJavaConfigFile(path: String) {
return path.endsWith('pom.xml') || path.endsWith('.gradle');
}

When the project file is updated, this function prevents from sending the command to eclipse.jdt.ls to update the project. More or less correct function should look like this:

function isJavaConfigFile(path: String) {
return path.endsWith('pom.xml') || path.endsWith('.gradle')
|| path.endsWith('BUILD') || path.endsWith('WORKSPACE');
}

But if the bazel support is not added to vscode, then this function will contain invalid behavior.

So my question is the following: what is the correct way to add bazel support in general and fix function isJavaConfigFile() in particular?

@jdneo
Copy link
Collaborator

jdneo commented Mar 10, 2021

Seems that we need to have a new contribution point that allow other extension to register the build file pattern. (Something like what we have for javaExtensions in package.json)

Proposal

Maybe a new entry named as javaBuildFilePatterns? For example:

"javaBuildFilePatterns": ["BUILD", "WORKSPACE"]

Any other ideas are open for discussion.

LeonovecSergey added a commit to LeonovecSergey/vscode-java that referenced this issue Mar 24, 2021
…e build file pattern.

Close redhat-developer#1825
Signed-off-by: Siarhei Leanavets siarhei_leanavets1@epam.com
LeonovecSergey added a commit to LeonovecSergey/vscode-java that referenced this issue Mar 24, 2021
…e build file pattern.

Close redhat-developer#1825
Signed-off-by: Siarhei Leanavets siarhei_leanavets1@epam.com

Signed-off-by: Siarhei Leanavets <Siarhei_Leanavets1@epam.com>
fbricon pushed a commit that referenced this issue Apr 20, 2021
…e build file pattern.

Close #1825
Signed-off-by: Siarhei Leanavets siarhei_leanavets1@epam.com

Signed-off-by: Siarhei Leanavets <Siarhei_Leanavets1@epam.com>
@fbricon fbricon added this to the End April 2021 milestone Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants