Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 527206 - Merge LSP support into master - inputManager.js changes
The change to inputManager.js was introduced to fix bug 518735.

See commit 7a4fd80.

Signed-off-by: Remy Suen <remy.suen@gmail.com>
  • Loading branch information
rcjsuen committed Jan 11, 2018
1 parent d483532 commit 62e60e0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bundles/org.eclipse.orion.client.ui/web/orion/inputManager.js
Expand Up @@ -21,8 +21,9 @@ define([
'orion/PageUtil',
'orion/editor/textModelFactory',
'orion/formatter',
'orion/lsp/languageServerRegistry',
'orion/metrics'
], function(messages, mNavigatorRenderer, i18nUtil, Deferred, EventTarget, objects, PageUtil, mTextModelFactory, mFormatter, mMetrics) {
], function(messages, mNavigatorRenderer, i18nUtil, Deferred, EventTarget, objects, PageUtil, mTextModelFactory, mFormatter, mLanguageServerRegistry, mMetrics) {

function Idle(options){
this._document = options.document || document;
Expand Down Expand Up @@ -147,6 +148,7 @@ define([
this.generalPreferences = options.generalPreferences || {};
this.isEditorTabsEnabled = options.isEditorTabsEnabled || false;
this._input = this._title = "";
this.languageServerRegistry = new mLanguageServerRegistry.LanguageServerRegistry(this.serviceRegistry, options.problemsServiceID || "orion.core.marker"); //$NON-NLS-0$
if (this.fileClient) {
this.fileClient.addEventListener("Changed", function(evt) { //$NON-NLS-0$
if (this._fileMetadata && this._fileMetadata._saving) {
Expand Down Expand Up @@ -454,6 +456,12 @@ define([
if (that.postSave) {
that.postSave(closing);
}
// get the lsp service matching the current content type
var lspLanguageServer = that.languageServerRegistry.getServerByContentType(that.getContentType());
if (lspLanguageServer) {
var text = lspLanguageServer.includeTextOnSave() ? that.getEditor().getText() : undefined;
lspLanguageServer.didSave(that.getFileMetadata().Location, text);
}
return done(result);
}
function errorHandler(error) {
Expand Down

0 comments on commit 62e60e0

Please sign in to comment.