diff --git a/.travis.yml b/.travis.yml index de3ab752..28d940b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,6 @@ install: - go get -u golang.org/x/tools/cmd/goimports - go get -u golang.org/x/tools/cmd/gorename - go get -u github.com/sqs/goreturns - - go get -u github.com/mdempsky/gocode - go get -u github.com/alecthomas/gometalinter - go get -u github.com/zmb3/gogetdoc - go get -u github.com/zmb3/goaddimport diff --git a/README.md b/README.md index 76c124fb..1cd321d9 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,9 @@ This package includes the following functionality: - Display information about your current go installation, by running `go version` and `go env` -- Autocomplete using `gocode` -- Format your code with `gofmt`, `goimports`, or `goreturns`; - optionally run one of these tools on save of any `.go` file -- Run `go install .` and `go test -c -o {tempdir} .` to verify your code compiles - and to keep `gocode` suggestions up to date +- Autocompletion +- Code formatting +- Compile on save - Run a variety of linters (e.g. `golint`, `vet`, etc.) against your code using [`gometalinter`](https://github.com/alecthomas/gometalinter), [`revive`](https://github.com/mgechev/revive) or [`golangci-lint`](https://github.com/golangci/golangci-lint) - Run tests, display test output, and display test coverage using `go test -coverprofile` - Display documentation for identifiers in source code using @@ -41,10 +39,6 @@ The following commands are run for the directory of the current file: - `go install .` (for normal `.go` files) - `go test -o {tmpdir} -c .` (for `_test.go` files) -### Why Are You Running `go install` Instead Of `go build`? - -`gocode` (and a few other tools, like `gotype`) work on `.a` files (i.e. the package object archive), and the way to keep these up to date is to run `go install` periodically. This ensures your autocomplete suggestions are kept up to date. - ## Platforms The package has CI for OS X, Windows and Ubuntu. @@ -57,13 +51,12 @@ If you are missing any required tools, you may be prompted to install them. You go get -u golang.org/x/tools/cmd/goimports go get -u golang.org/x/tools/cmd/gorename go get -u github.com/sqs/goreturns -go get -u github.com/mdempsky/gocode +go get -u golang.org/x/tools/cmd/gopls go get -u github.com/alecthomas/gometalinter go get -u github.com/mgechev/revive go get -u github.com/golangci/golangci-lint/cmd/golangci-lint go get -u github.com/zmb3/gogetdoc go get -u github.com/zmb3/goaddimport -go get -u github.com/rogpeppe/godef go get -u golang.org/x/tools/cmd/guru go get -u github.com/fatih/gomodifytags go get -u github.com/tpng/gopkgs diff --git a/appveyor.yml b/appveyor.yml index 840c3345..adb01751 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -30,7 +30,6 @@ install: - go get -u golang.org/x/tools/cmd/goimports - go get -u golang.org/x/tools/cmd/gorename - go get -u github.com/sqs/goreturns - - go get -u github.com/mdempsky/gocode - go get -u github.com/alecthomas/gometalinter - go get -u github.com/zmb3/gogetdoc - go get -u github.com/zmb3/goaddimport diff --git a/lib/build/builder.js b/lib/build/builder.js index 39697ce4..6afe824b 100644 --- a/lib/build/builder.js +++ b/lib/build/builder.js @@ -157,8 +157,8 @@ class Builder { } const srcDir = gopath + sep + 'src' return srcDir.split(sep).every((t, i) => cwd.split(sep)[i] === t) - ? 'install' // CWD is within gopath, `go install` to keep gocode up to date - : 'build' // CWD is outside gopath, `go build` will suffice + ? 'install' // CWD is within gopath, `go install` + : 'build' // CWD is outside gopath, `go build` } async lintInstall(cmd: string, options: ExecutorOptions) { @@ -177,7 +177,6 @@ class Builder { } // Include the -i flag with go install. - // See: https://github.com/mdempsky/gocode/issues/79 if (command === 'install' && !buildArgs.includes('-i')) { buildArgs.push('-i') } diff --git a/lib/languageclient.js b/lib/languageclient.js new file mode 100644 index 00000000..d247b280 --- /dev/null +++ b/lib/languageclient.js @@ -0,0 +1,491 @@ +// @flow + +import { spawn } from 'child_process' +import os from 'os' +import { Disposable } from 'atom' +import { AutoLanguageClient } from 'atom-languageclient' +import type { PanelModel } from './panel/tab' +import type { Renderable } from './etch-component' + +// TODO: package manager + +class GoLanguageClient extends AutoLanguageClient { + orchestrator = null + bootstrap = null + configservice = null + getservice = null + loaded: boolean = false + builder = null + linterDelegate: any = null + buildLinterDelegate: any = null + panelManager = null + outputManager = null + information = null + golinter = null + godoc = null + tester = null + gomodifytags = null + implements = null + importer = null + references = null + + getGrammarScopes(): Array { + return ['source.go', 'go'] + } + + getLanguageName(): string { + return 'Go' + } + + getServerName(): string { + return 'gopls' + } + + getConnectionType(): string { + return 'stdio' + } + + async startServerProcess() { + const cmd = await this.provideGoConfig().locator.findTool('gopls') + if (cmd) { + return spawn(cmd, ['serve']) + } + + const notification = atom.notifications.addError('go-plus', { + dismissable: true, + detail: 'Missing `gopls`', + description: + 'The `gopls` language server could not be found' + + os.EOL + + os.EOL + + 'Would you like to install it?', + buttons: [ + { + text: 'Yes', + onDidClick: async () => { + notification.dismiss() + this.provideGoGet() + const gs: any = this.getservice + gs.getmanager.performGet('golang.org/x/tools/cmd/gopls') + this.promptForReload() + } + }, + { + text: 'No', + ondidClick: () => notification.dismiss() + } + ] + }) + } + + promptForReload() { + const notification = atom.notifications.addInfo('go-plus', { + dismissable: false, + detail: 'Please reload', + description: + '`gopls` has been installed. Please reload Atom to start the language server.' + + os.EOL + + os.EOL + + 'Would you like to reload now?', + buttons: [ + { + text: 'Yes', + onDidClick: () => + atom.commands.dispatch( + atom.views.getView(atom.workspace), + 'window:reload' + ) + }, + { text: 'No', onDidClick: () => notification.dismiss() } + ] + }) + } + + consumeLinterV2(register) { + // handles diagnostics from language server + super.consumeLinterV2(register) + + // provide diagnostics from additional linters + this.buildLinterDelegate = register({ name: 'go build' }) + this.linterDelegate = register({ name: 'go linter' }) + if (this._disposable) { + this._disposable.add(this.buildLinterDelegate, this.linterDelegate) + } + } + + consumeConsole(createConsole) { + const disp = super.consumeConsole(createConsole) + this.console = createConsole({ id: 'go-plus', name: 'go-plus' }) + return new Disposable(() => { + this.console.dispose() + this.console = null + disp.dispose() + }) + } + + consumeDatatip(service) { + // dont leverage gopls for datatips yet (it doesn't show documentation) + // super.consumeDatatip(service) + service.addProvider(this.loadDoc()) + } + + provideFindReferences() { + // TODO: remove me when gopls supports references + //return super.provideFindReferences() + + if (this.references) { + return this.references + } + + const { ReferencesProvider } = require('./references/references-provider') + this.references = new ReferencesProvider(this.provideGoConfig()) + return this.references + } + + activate() { + super.activate() + + const { Orchestrator } = require('./orchestrator') + this.orchestrator = new Orchestrator() + this._disposable.add(this.orchestrator) + + const { Bootstrap } = require('./bootstrap') + this.bootstrap = new Bootstrap(() => { + this.bootstrapped = true + this.load() + this.loaded = true + this.checkFormatOnSave() + }) + this._disposable.add(this.bootstrap) + } + + deactivate() { + super.deactivate() + this.loaded = false + this.bootstrapped = false + + this.bootstrap = null + this.builder = null + this.configservice = null + this.getservice = null + this.information = null + this.golinter = null + this.orchestrator = null + this.outputManager = null + this.panelManager = null + this.tester = null + this.godoc = null + this.gomodifytags = null + this.implements = null + this.importer = null + this.references = null + } + + load() { + this.loadBuilder() + this.loadTester() + this.loadLinter() + this.loadOutput() + this.loadInformation() + this.loadDoc() + this.loadGoModifyTags() + this.loadImplements() + this.loadImporter() + + if (!atom.config.get('go-plus.testing')) { + this.loadPackageManager() + } + + this.getPanelManager().requestUpdate() + this.loaded = true + } + + provideGoConfig() { + if (this.configservice) { + return this.configservice.provide() + } + const { ConfigService } = require('./config/service') + this.configservice = new ConfigService(() => this.console) + if (this._disposable) { + this._disposable.add(this.configservice) + } + return this.configservice.provide() + } + + provideGoGet() { + if (this.getservice) { + return this.getservice.provide() + } + const { GetService } = require('./get/service') + this.getservice = new GetService( + this.provideGoConfig(), + () => this.loadOutput(), + () => this.busySignalService + ) + return this.getservice.provide() + } + + consumeViewProvider(provider: { + view: Class, + model: PanelModel + }) { + if (!provider) { + // for simplified type handling just assume + // that this never happens for our own code + return (null: any) + } + + return this.getPanelManager().registerViewProvider( + provider.view, + provider.model + ) + } + + getPanelManager() { + if (this.panelManager) { + return this.panelManager + } + const { PanelManager } = require('./panel/panel-manager') + this.panelManager = new PanelManager() + + if (this._disposable) { + this._disposable.add(this.panelManager) + } + + return this.panelManager + } + + loadBuilder() { + if (this.builder) return this.builder + + const { Builder } = require('./build/builder') + this.builder = new Builder( + this.provideGoConfig(), + () => this.buildLinterDelegate, + this.loadOutput(), + () => this.busySignalService + ) + + // register for save events + if (!this.orchestrator) return + this._disposable.add( + this.orchestrator.register( + 'builder', + (editor: TextEditor, path: string) => { + if (this.builder) this.builder.build(editor, path) + } + ) + ) + } + + loadDoc() { + if (this.godoc) { + return this.godoc + } + + const { Godoc } = require('./doc/godoc') + const godoc = new Godoc(this.provideGoConfig()) + this.godoc = godoc + + const { GodocView } = require('./doc/godoc-view') + const view = this.consumeViewProvider({ + view: GodocView, + model: godoc.getPanel() + }) + + if (this._disposable) { + this._disposable.add(godoc, view) + } + return godoc + } + + loadTester() { + if (this.tester) return this.tester + + const { Tester } = require('./test/tester') + this.tester = new Tester( + this.provideGoConfig(), + this.loadOutput(), + () => this.busySignalService + ) + if (this._disposable) this._disposable.add(this.tester) + + // register for save events + if (this.orchestrator) { + this._disposable.add( + this.orchestrator.register( + 'tester', + (editor: TextEditor, path: string) => { + void path + if (this.tester) this.tester.handleSaveEvent(editor) + } + ) + ) + } + + return this.tester + } + + loadLinter() { + if (this.golinter) return this.golinter + + const { Linter } = require('./lint/linter') + this.golinter = new Linter( + this.provideGoConfig(), + () => this.linterDelegate, + () => this.busySignalService + ) + + // register for save events + if (this.orchestrator) { + this._disposable.add( + this.orchestrator.register( + 'linter', + (editor: TextEditor, path: string) => { + void path + if (this.golinter) this.golinter.lint(editor) + } + ) + ) + } + + return this.golinter + } + + loadInformation() { + if (this.information) { + return this.information + } + + const { InformationView } = require('./info/information-view') + const { Information } = require('./info/information') + const information = new Information(this.provideGoConfig()) + this.information = information + const view = this.consumeViewProvider({ + view: InformationView, + model: information + }) + if (this._disposable) { + this._disposable.add(information, view) + } + + return this.information + } + + loadOutput() { + if (this.outputManager) { + return this.outputManager + } + const { OutputManager } = require('./output-manager') + const outputManager = new OutputManager() + this.outputManager = outputManager + + const { OutputPanel } = require('./output-panel') + const view = this.consumeViewProvider({ + view: OutputPanel, + model: this.outputManager + }) + + if (this._disposable) { + this._disposable.add(view) + } + + return outputManager + } + + loadGoModifyTags() { + if (this.gomodifytags) { + return this.gomodifytags + } + const { GoModifyTags } = require('./tags/gomodifytags') + this.gomodifytags = new GoModifyTags(this.provideGoConfig()) + if (this._disposable) { + this._disposable.add(this.gomodifytags) + } + return this.gomodifytags + } + + loadImplements() { + if (this.implements) { + return this.implements + } + const { Implements } = require('./implements/implements') + const impls = new Implements(this.provideGoConfig()) + this.implements = impls + const { ImplementsView } = require('./implements/implements-view') + const view = this.consumeViewProvider({ + view: ImplementsView, + model: impls + }) + if (this._disposable) { + this._disposable.add(impls, view) + } + return impls + } + + loadImporter() { + if (this.importer) { + return this.importer + } + const { Importer } = require('./import/importer') + this.importer = new Importer(this.provideGoConfig()) + return this.importer + } + + loadPackageManager() { + if (this.packagemanager) { + return this.packagemanager + } + + const { PackageManager } = require('./package-manager') + this.packagemanager = new PackageManager( + this.provideGoConfig(), + this.provideGoGet() + ) + + if (this._disposable) { + this._disposable.add(this.packagemanager) + } + + return this.packagemanager + } + + checkFormatOnSave() { + const skip = atom.config.get('go-plus.skipCodeFormatCheck') + if (skip) return + + const formatOnSave = atom.config.get( + 'atom-ide-ui.atom-ide-code-format.formatOnSave' + ) + if (formatOnSave) return + + const n = atom.notifications.addInfo('go-plus', { + buttons: [ + { + text: 'Yes', + onDidClick: () => { + atom.config.set( + 'atom-ide-ui.atom-ide-code-format.formatOnSave', + true + ) + n.dismiss() + } + }, + { text: 'No', onDidClick: () => n.dismiss() }, + { + text: `Never (don't ask me again)`, + onDidClick: () => { + atom.config.set('go-plus.skipCodeFormatCheck', true) + n.dismiss() + } + } + ], + dismissable: true, + description: + "In order for go-plus to format code on save, `atom-ide-ui`'s " + + 'format on save option must be enabled. Would you like to enable it now?' + }) + } +} + +module.exports = new GoLanguageClient() diff --git a/lib/package-manager.js b/lib/package-manager.js index 451b4ac3..8a3c93e5 100644 --- a/lib/package-manager.js +++ b/lib/package-manager.js @@ -7,54 +7,32 @@ import type { GoConfig } from './config/service' import type { GoGet } from './get/service' import type { ToolChecker } from './tool-checker' -const oldPackages = [ - 'gofmt', - 'tester-go', - 'builder-go', - 'autocomplete-go', - 'godoc', - 'gorename', - 'go-hyperclick', - 'navigator-go', - 'go-get', - 'go-config', - 'gometalinter-linter' -] - const bundledPackages = new Map([ [ 'go-debug', - 'It allows you to interactively debug your go program and tests using delve.' - ], - [ - 'go-signature-statusbar', - 'It shows function signature information in the status bar.' + 'Allows you to interactively debug your go program and tests using delve.' ], - ['atom-ide-ui', 'It provides IDE features and displays diagnostic messages.'] + ['atom-ide-ui', 'Provides IDE features and displays diagnostic messages.'] ]) const goTools = new Map([ + ['gopls', 'golang.org/x/tools/cmd/gopls'], + ['revive', 'github.com/mgechev/revive'], + ['gogetdoc', 'github.com/zmb3/gogetdoc'], + ['golangci-lint', 'github.com/golangci/golangci-lint/cmd/golangci-lint'], ['goimports', 'golang.org/x/tools/cmd/goimports'], ['gorename', 'golang.org/x/tools/cmd/gorename'], ['goreturns', 'github.com/sqs/goreturns'], - ['gocode', 'github.com/stamblerre/gocode'], - ['gometalinter', 'github.com/alecthomas/gometalinter'], - ['revive', 'github.com/mgechev/revive'], - ['golangci-lint', 'github.com/golangci/golangci-lint/cmd/golangci-lint'], - ['gogetdoc', 'github.com/zmb3/gogetdoc'], ['goaddimport', 'github.com/zmb3/goaddimport'], - ['godef', 'github.com/rogpeppe/godef'], ['guru', 'golang.org/x/tools/cmd/guru'], ['gomodifytags', 'github.com/fatih/gomodifytags'], - ['gopkgs', 'github.com/tpng/gopkgs'], - ['go-outline', 'github.com/ramya-rao-a/go-outline'] + ['gopkgs', 'github.com/tpng/gopkgs'] ]) class PackageManager { goconfig: GoConfig goget: GoGet willInstall: boolean - willUninstall: boolean loaded: boolean subscriptions: CompositeDisposable toolChecker: ToolChecker @@ -74,16 +52,8 @@ class PackageManager { this.toolChecker = new ToolChecker(this.goconfig) } this.toolChecker.checkForTools(Array.from(goTools.keys())) - this.disableOldPackages() - this.willUninstall = true this.willInstall = true this.loaded = true - setTimeout(() => { - if (!this.willUninstall) { - return - } - this.uninstallOldPackages() - }, 10000) setTimeout(() => { if (!this.willInstall) { return @@ -97,20 +67,9 @@ class PackageManager { this.subscriptions.dispose() } this.loaded = false - this.willUninstall = false this.willInstall = true } - disableOldPackages() { - for (const pkg of oldPackages) { - const p = atom.packages.getLoadedPackage(pkg) - if (!p) { - continue - } - atom.packages.disablePackage(pkg) - } - } - async installBundledPackages() { let packages = new Map() for (const [pkg, detail] of bundledPackages) { @@ -219,130 +178,13 @@ class PackageManager { } } - async uninstallOldPackages() { - // remove old packages that have been merged into go-plus - for (const pkg of oldPackages) { - const p = atom.packages.getLoadedPackage(pkg) - if (!p) { - continue - } - const pack = await atom.packages.activatePackage('settings-view') - if (pack && pack.mainModule) { - const settingsview = pack.mainModule.createSettingsView({ - uri: pack.mainModule.configUri - }) - settingsview.packageManager.uninstall({ name: pkg }, error => { - if (!error) { - atom.notifications.addInfo( - `Removed the ${pkg} package, which is now provided by go-plus` - ) - } else { - console.log(error) // eslint-disable-line no-console - } - }) - } - } - } - async registerTools() { if (!this.goget || !this.subscriptions) { return } - for (const [key, value] of goTools) { + for (const [, value] of goTools) { const packagePath = value - if (key === 'gometalinter') { - this.subscriptions.add( - this.goget.register(packagePath, async (outcome, packs) => { - if (!packs.includes(packagePath)) { - return - } - const cmd = await this.goconfig.locator.findTool('gometalinter') - if (!cmd) { - return - } - const notification = atom.notifications.addInfo('gometalinter', { - dismissable: true, - icon: 'cloud-download', - description: 'Running `gometalinter --install` to install tools.' - }) - const opt = this.goconfig.executor.getOptions('project') - const r = await this.goconfig.executor.exec(cmd, ['--install'], opt) - notification.dismiss() - const stdout = - r.stdout instanceof Buffer ? r.stdout.toString() : r.stdout - const stderr = - r.stderr instanceof Buffer ? r.stderr.toString() : r.stderr - const detail = stdout + os.EOL + stderr - - if (r.exitcode !== 0) { - atom.notifications.addWarning('gometalinter', { - dismissable: true, - icon: 'cloud-download', - detail: detail.trim() - }) - return r - } - if (stderr && stderr.trim() !== '') { - console.log('go-plus: (stderr) ' + stderr) // eslint-disable-line no-console - } - atom.notifications.addSuccess('gometalinter', { - dismissable: true, - icon: 'cloud-download', - detail: detail.trim(), - description: 'The tools were installed.' - }) - return r - }) - ) - } else if (key === 'gocode') { - this.subscriptions.add( - this.goget.register(packagePath, async (outcome, packs) => { - if (!packs.includes(packagePath)) { - return - } - const cmd = await this.goconfig.locator.findTool('gocode') - if (!cmd) { - return - } - const notification = atom.notifications.addInfo('gocode', { - dismissable: true, - icon: 'cloud-download', - description: - 'Running `gocode close` to ensure a new gocode binary is used.' - }) - const opt = this.goconfig.executor.getOptions('project') - const r = await this.goconfig.executor.exec(cmd, ['close'], opt) - notification.dismiss() - const stdout = - r.stdout instanceof Buffer ? r.stdout.toString() : r.stdout - const stderr = - r.stderr instanceof Buffer ? r.stderr.toString() : r.stderr - const detail = stdout + os.EOL + stderr - - if (r.exitcode !== 0) { - atom.notifications.addWarning('gocode', { - dismissable: true, - icon: 'sync', - detail: detail.trim() - }) - return r - } - if (stderr && stderr.trim() !== '') { - console.log('go-plus: (stderr) ' + stderr) // eslint-disable-line no-console - } - atom.notifications.addSuccess('gocode', { - dismissable: true, - icon: 'sync', - detail: detail.trim(), - description: - 'The `gocode` daemon has been closed to ensure you are using the latest `gocode` binary.' - }) - return r - }) - ) - } else { - this.subscriptions.add(this.goget.register(packagePath)) - } + this.subscriptions.add(this.goget.register(packagePath)) } } } diff --git a/package-lock.json b/package-lock.json index 51981b41..7375a98a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -287,6 +287,17 @@ "babel-core": "6.x" } }, + "atom-languageclient": { + "version": "0.9.9", + "resolved": "https://registry.npmjs.org/atom-languageclient/-/atom-languageclient-0.9.9.tgz", + "integrity": "sha512-eAKLFhprcDksPtDtG2lrhQEosNMxEbS7MISpw7n6TIoPmTgolvo+GPAF+nSV+Z9MCss91i+M+TNk9Mj5C7y/CQ==", + "requires": { + "fuzzaldrin-plus": "^0.6.0", + "vscode-jsonrpc": "4.0.0", + "vscode-languageserver-protocol": "3.12.0", + "vscode-languageserver-types": "3.12.0" + } + }, "atom-select-list": { "version": "0.7.2", "resolved": "https://registry.npmjs.org/atom-select-list/-/atom-select-list-0.7.2.tgz", @@ -1974,6 +1985,32 @@ "punycode": "^2.1.0" } }, + "vscode-jsonrpc": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz", + "integrity": "sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg==" + }, + "vscode-languageserver-protocol": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.12.0.tgz", + "integrity": "sha512-evY6hmyzLnwQrqlQWPrNBq1z8wrSNjLesmgPzeS6Zv11mVS5UJRel26hbM/DH5tHdn45huNzRW0eFHRmIm8LpA==", + "requires": { + "vscode-jsonrpc": "^3.6.2", + "vscode-languageserver-types": "^3.12.0" + }, + "dependencies": { + "vscode-jsonrpc": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.6.2.tgz", + "integrity": "sha512-T24Jb5V48e4VgYliUXMnZ379ItbrXgOimweKaJshD84z+8q7ZOZjJan0MeDe+Ugb+uqERDVV8SBmemaGMSMugA==" + } + } + }, + "vscode-languageserver-types": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.12.0.tgz", + "integrity": "sha512-UxqnpzBToPO7Mi2tr/s5JeyPOSKSJtLB8lIdxCg9ZNdvP2cU8wS7iTDtwQKz91Ne4CUmTdf85ddR5SIZKXmMjQ==" + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", diff --git a/package.json b/package.json index cd1ffb66..6ef9e075 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "guru" ], "version": "6.1.0", - "main": "./lib/main", + "main": "./lib/languageclient", "scripts": { "flow": "flow", "lint": "eslint ./lib ./spec", @@ -76,6 +76,7 @@ "@atom/temp": "^0.8.4", "ansi-style-parser": "^2.0.0", "atom-babel6-transpiler": "^1.2.0", + "atom-languageclient": "^0.9.9", "atom-select-list": "^0.7.2", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", @@ -112,6 +113,11 @@ "2.0.0": "provideGoGet" } }, + "code-actions": { + "versions": { + "0.1.0": "provideCodeActions" + } + }, "autocomplete.provider": { "versions": { "2.0.0": "provideAutocomplete" @@ -124,7 +130,7 @@ }, "find-references": { "versions": { - "0.1.0": "provideReferences" + "0.1.0": "provideFindReferences" } }, "code-highlight": { @@ -132,9 +138,9 @@ "0.1.0": "provideCodeHighlight" } }, - "code-format.file": { + "code-format.range": { "versions": { - "0.1.0": "provideCodeFormatter" + "0.1.0": "provideCodeFormat" } }, "outline-view": { @@ -151,12 +157,17 @@ }, "linter-indie": { "versions": { - "2.0.0": "consumeLinter" + "2.0.0": "consumeLinterV2" + } + }, + "signature-help": { + "versions": { + "0.1.0": "consumeSignatureHelp" } }, "datatip": { "versions": { - "0.1.0": "consumeDatatipService" + "0.1.0": "consumeDatatip" } }, "atom-ide-busy-signal": { diff --git a/spec/get/provider-spec.js b/spec/get/provider-spec.js index 4def0e27..b0331856 100644 --- a/spec/get/provider-spec.js +++ b/spec/get/provider-spec.js @@ -50,8 +50,6 @@ describe('go-get service provider', () => { it('registers a package', () => { provider.register('github.com/mdempsky/gocode') expect(manager.packages.size).toBe(1) - provider.register('github.com/mdempsky/gocode') - expect(manager.packages.size).toBe(1) }) it('registers the same package multiple times', () => {