mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 08:48:55 +00:00
[lsp] moved filesystemscanner to xtext.utils and LSPExtensions to lsapi project
This commit is contained in:
parent
cea7256665
commit
cb3f89d33d
4 changed files with 9 additions and 49 deletions
|
@ -1,32 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*******************************************************************************/
|
||||
package org.eclipse.xtext.ide.server
|
||||
|
||||
import io.typefox.lsapi.PositionImpl
|
||||
import io.typefox.lsapi.RangeImpl
|
||||
|
||||
/**
|
||||
* @author Sven Efftinge - Initial contribution and API
|
||||
*/
|
||||
class LSPExtensions {
|
||||
|
||||
|
||||
static def PositionImpl newPosition(int line, int character) {
|
||||
new PositionImpl => [
|
||||
it.line = line
|
||||
it.character = character
|
||||
]
|
||||
}
|
||||
|
||||
static def RangeImpl newRange(PositionImpl start, PositionImpl end) {
|
||||
new RangeImpl => [
|
||||
it.start = start
|
||||
it.end = end
|
||||
]
|
||||
}
|
||||
}
|
|
@ -33,7 +33,6 @@ import io.typefox.lsapi.InitializeResultImpl
|
|||
import io.typefox.lsapi.LanguageServer
|
||||
import io.typefox.lsapi.MessageParams
|
||||
import io.typefox.lsapi.NotificationCallback
|
||||
import io.typefox.lsapi.PositionImpl
|
||||
import io.typefox.lsapi.PublishDiagnosticsParams
|
||||
import io.typefox.lsapi.PublishDiagnosticsParamsImpl
|
||||
import io.typefox.lsapi.RangeImpl
|
||||
|
@ -43,7 +42,6 @@ import io.typefox.lsapi.ServerCapabilitiesImpl
|
|||
import io.typefox.lsapi.ShowMessageRequestParams
|
||||
import io.typefox.lsapi.TextDocumentPositionParams
|
||||
import io.typefox.lsapi.TextDocumentService
|
||||
import io.typefox.lsapi.TextEditImpl
|
||||
import io.typefox.lsapi.WindowService
|
||||
import io.typefox.lsapi.WorkspaceService
|
||||
import io.typefox.lsapi.WorkspaceSymbolParams
|
||||
|
@ -52,6 +50,8 @@ import org.eclipse.emf.common.util.URI
|
|||
import org.eclipse.xtend.lib.annotations.Accessors
|
||||
import org.eclipse.xtext.validation.Issue
|
||||
|
||||
import static io.typefox.lsapi.util.LsapiFactories.*
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sven Efftinge - Initial contribution and API
|
||||
|
@ -101,10 +101,7 @@ import org.eclipse.xtext.validation.Issue
|
|||
|
||||
override didChange(DidChangeTextDocumentParams params) {
|
||||
workspaceManager.didChange(params.textDocument.uri.toUri, params.textDocument.version, params.contentChanges.map [ event |
|
||||
val edit = new TextEditImpl
|
||||
edit.range = event.range as RangeImpl
|
||||
edit.newText = event.text
|
||||
return edit
|
||||
newTextEdit(event.range as RangeImpl, event.text)
|
||||
])
|
||||
}
|
||||
|
||||
|
@ -166,16 +163,10 @@ import org.eclipse.xtext.validation.Issue
|
|||
default : Diagnostic.SEVERITY_HINT
|
||||
}
|
||||
message = issue.message
|
||||
range = new RangeImpl => [
|
||||
start = new PositionImpl => [
|
||||
line = issue.lineNumber
|
||||
character = issue.column
|
||||
]
|
||||
end = new PositionImpl => [
|
||||
line = issue.lineNumber
|
||||
character = issue.column + issue.length
|
||||
]
|
||||
]
|
||||
range = newRange(
|
||||
newPosition(issue.lineNumber,issue.column),
|
||||
newPosition(issue.lineNumber,issue.column + issue.length)
|
||||
)
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.eclipse.xtext.resource.impl.ChunkedResourceDescriptions
|
|||
import org.eclipse.xtext.resource.impl.ProjectDescription
|
||||
import org.eclipse.xtext.resource.impl.ResourceDescriptionsData
|
||||
import org.eclipse.xtext.validation.Issue
|
||||
import org.eclipse.xtext.util.IFileSystemScanner
|
||||
|
||||
/**
|
||||
* @author Sven Efftinge - Initial contribution and API
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*******************************************************************************/
|
||||
package org.eclipse.xtext.ide.server
|
||||
package org.eclipse.xtext.util
|
||||
|
||||
import org.eclipse.xtext.util.IAcceptor
|
||||
import org.eclipse.emf.common.util.URI
|
Loading…
Reference in a new issue