Skip to content

Commit d4d8308

Browse files
author
Pavel Mitrafanau
committed
Add POC version of Bazel VS Code extension
0 parents  commit d4d8308

File tree

15 files changed

+5679
-0
lines changed

15 files changed

+5679
-0
lines changed

.eslintrc.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"env": {
3+
"browser": false,
4+
"commonjs": true,
5+
"es6": true,
6+
"node": true,
7+
"mocha": true
8+
},
9+
"parserOptions": {
10+
"ecmaVersion": 2018,
11+
"ecmaFeatures": {
12+
"jsx": true
13+
},
14+
"sourceType": "module"
15+
},
16+
"rules": {
17+
"no-const-assign": "warn",
18+
"no-this-before-super": "warn",
19+
"no-undef": "warn",
20+
"no-unreachable": "warn",
21+
"no-unused-vars": "warn",
22+
"constructor-super": "warn",
23+
"valid-typeof": "warn"
24+
}
25+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.vscode-test/
3+
*.vsix

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "bazel-ls-eclipse"]
2+
path = bazel-ls-eclipse
3+
url = https://github.com/salesforce/bazel-ls-eclipse

.vscode/launch.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Run Extension",
6+
"type": "extensionHost",
7+
"request": "launch",
8+
"runtimeExecutable": "${execPath}",
9+
"args": [
10+
"--extensionDevelopmentPath=${workspaceFolder}"
11+
]
12+
},
13+
{
14+
"name": "Extension Tests",
15+
"type": "extensionHost",
16+
"request": "launch",
17+
"runtimeExecutable": "${execPath}",
18+
"args": [
19+
"--extensionDevelopmentPath=${workspaceFolder}",
20+
"--extensionTestsPath=${workspaceFolder}/test/suite/index"
21+
]
22+
}
23+
]
24+
}

.vscodeignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.vscode/**
2+
.vscode-test/**
3+
test/**
4+
.gitignore
5+
**/jsconfig.json
6+
**/*.map
7+
**/.eslintrc.json
8+
gulpfile.js
9+
node_modules
10+
bazel-ls-eclipse/**
11+
!bazel-ls-eclipse/com.salesforce.b2eclipse.jdt.ls/target/com.salesforce.b2eclipse.jdt.ls-*.jar

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2020, Salesforce
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[![](https://img.shields.io/badge/license-BSD%203-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
2+
3+
Bazel for Java
4+
===========================
5+
6+
Installation
7+
--------------------
8+
1. [Install](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#installation) `vsce` CLI tool:
9+
```bash
10+
npm install -g vsce
11+
```
12+
2. Clone the repository
13+
```bash
14+
git clone --recurse-submodules [email protected]:salesforce/bazel-ls-vscode.git
15+
```
16+
3. Install the dependencies:
17+
```bash
18+
cd bazel-ls-vscode
19+
npm install
20+
```
21+
4. Package the extension:
22+
```bash
23+
vsce package
24+
```
25+
5. Open the _Extensions_ tab in VS Code
26+
6. Select _Install from VSIX..._ and choose file built in the fourth step
27+
7. Once installed, restart VS Code

bazel-ls-eclipse

Submodule bazel-ls-eclipse added at 0f66be1

extension.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const vscode = require('vscode');
2+
3+
function activate() {
4+
vscode.window.showInformationMessage('Basel JDT LS is activated');
5+
}
6+
7+
exports.activate = activate;
8+
9+
function deactivate() {}
10+
11+
module.exports = {
12+
activate,
13+
deactivate
14+
}

gulpfile.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT license.
3+
4+
const gulp = require('gulp');
5+
const cp = require('child_process');
6+
const path = require('path');
7+
const serverDir = path.join(__dirname, 'bazel-ls-eclipse');
8+
9+
gulp.task('build-plugin', (done) => {
10+
cp.execSync(`${mvnw()} clean package`, { cwd: serverDir, stdio: [0, 1, 2] });
11+
done();
12+
});
13+
14+
function isWin() {
15+
return /^win/.test(process.platform);
16+
}
17+
18+
function mvnw() {
19+
return isWin() ? 'mvnw.cmd' : './mvnw';
20+
}

0 commit comments

Comments
 (0)