Change vscode-boot-java in a 'dummy' extension
It pops up a message on activation advising user to uninstall it and install vscode-spring-boot instead.
This commit is contained in:
@@ -1,48 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
import * as net from 'net';
|
||||
|
||||
import * as VSCode from 'vscode';
|
||||
import * as Path from 'path';
|
||||
import * as FS from 'fs';
|
||||
import * as Net from 'net';
|
||||
import * as ChildProcess from 'child_process';
|
||||
import { LanguageClient, LanguageClientOptions, SettingMonitor, ServerOptions, StreamInfo } from 'vscode-languageclient';
|
||||
import { workspace, TextDocument } from 'vscode';
|
||||
import { Trace } from 'vscode-jsonrpc';
|
||||
|
||||
import * as commons from 'commons-vscode';
|
||||
import { connect } from 'tls';
|
||||
|
||||
/** Called when extension is activated */
|
||||
export function activate(context: VSCode.ExtensionContext) {
|
||||
let options: commons.ActivatorOptions = {
|
||||
DEBUG: false,
|
||||
CONNECT_TO_LS: false,
|
||||
extensionId: 'boot-java',
|
||||
preferJdk: true,
|
||||
launcher: (context: VSCode.ExtensionContext) => 'org.springframework.boot.loader.JarLauncher',
|
||||
classpath: (context: VSCode.ExtensionContext, jvm: commons.JVM) => {
|
||||
const classpath = [
|
||||
Path.resolve(context.extensionPath, 'jars/language-server.jar')
|
||||
];
|
||||
if (!jvm.isJdk()) {
|
||||
VSCode.window.showWarningMessage('JAVA_HOME or PATH environment variable seems to point to a JRE. A JDK is required, hence Boot Hints are unavailable.');
|
||||
}
|
||||
const toolsJar = jvm.getToolsJar();
|
||||
if (toolsJar) {
|
||||
classpath.unshift(toolsJar);
|
||||
}
|
||||
return classpath;
|
||||
},
|
||||
clientOptions: {
|
||||
documentSelector: ['java'],
|
||||
synchronize: {
|
||||
configurationSection: 'boot-java'
|
||||
},
|
||||
initializationOptions: {
|
||||
workspaceFolders: workspace.workspaceFolders ? workspace.workspaceFolders.map(f => f.uri.toString()) : null
|
||||
},
|
||||
}
|
||||
};
|
||||
commons.activate(options, context);
|
||||
VSCode.window.showInformationMessage(
|
||||
"The `vscode-boot-java` extension is obsolete and no longer functional. "+
|
||||
"Please uninstall it and install the `vscode-spring-boot` extension instead."
|
||||
);
|
||||
}
|
||||
|
||||
@@ -25,31 +25,16 @@
|
||||
"activationEvents": [
|
||||
"onLanguage:java"
|
||||
],
|
||||
"contributes": {
|
||||
"configuration": {
|
||||
"type": "object",
|
||||
"title": "Boot-Java Configuration",
|
||||
"properties": {
|
||||
"boot-java.boot-hints.on": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Enable/Disable Spring running Boot application live hints decorators in the source code"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"main": "./out/lib/Main",
|
||||
"scripts": {
|
||||
"vscode:prepublish": "npm run compile",
|
||||
"compile": "tsc -p ./",
|
||||
"watch": "tsc -watch -p ./",
|
||||
"clean": "rm -fr node_modules out *.vsix package-lock.json",
|
||||
"preinstall": "./scripts/preinstall.sh",
|
||||
"postinstall": "node ./node_modules/vscode/bin/install",
|
||||
"vsce-package": "vsce package"
|
||||
},
|
||||
"dependencies": {
|
||||
"commons-vscode": "file:../commons-vscode/commons-vscode-0.1.4.tgz",
|
||||
"vscode-languageclient": "^3.4.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
workdir=`pwd`
|
||||
|
||||
# Preinstall commons-vscode package
|
||||
(cd ../commons-vscode ; npm install ; npm pack)
|
||||
npm install ../commons-vscode/commons-vscode-*.tgz
|
||||
|
||||
# Use maven to build fat jar of the language server
|
||||
cd ../../headless-services/boot-java-language-server
|
||||
./build.sh
|
||||
|
||||
mkdir -p ${workdir}/jars
|
||||
cp target/*.jar ${workdir}/jars/language-server.jar
|
||||
|
||||
Reference in New Issue
Block a user