Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
B Language Server
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
B Language Server
Commits
dc961daf
Commit
dc961daf
authored
Oct 28, 2020
by
SeeBasTStick
Browse files
Options
Downloads
Patches
Plain Diff
removed anonymous function and unused feature - both leading to problems
parent
85d43791
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/kotlin/b/language/server/Server.kt
+1
-1
1 addition, 1 deletion
src/main/kotlin/b/language/server/Server.kt
src/main/kotlin/b/language/server/proBMangement/prob/ProBKernel.kt
+28
-32
28 additions, 32 deletions
...kotlin/b/language/server/proBMangement/prob/ProBKernel.kt
with
29 additions
and
33 deletions
src/main/kotlin/b/language/server/Server.kt
+
1
−
1
View file @
dc961daf
...
@@ -28,7 +28,7 @@ class Server : LanguageServer{
...
@@ -28,7 +28,7 @@ class Server : LanguageServer{
res
.
capabilities
.
textDocumentSync
=
Either
.
forLeft
(
TextDocumentSyncKind
.
Full
)
res
.
capabilities
.
textDocumentSync
=
Either
.
forLeft
(
TextDocumentSyncKind
.
Full
)
res
.
capabilities
.
workspace
=
WorkspaceServerCapabilities
(
WorkspaceFoldersOptions
())
res
.
capabilities
.
workspace
=
WorkspaceServerCapabilities
(
WorkspaceFoldersOptions
())
res
.
capabilities
.
workspace
.
workspaceFolders
.
supported
=
true
res
.
capabilities
.
workspace
.
workspaceFolders
.
supported
=
true
res
.
capabilities
.
completionProvider
=
CompletionOptions
()
//
res.capabilities.completionProvider = CompletionOptions()
return
CompletableFuture
.
supplyAsync
{
res
}
return
CompletableFuture
.
supplyAsync
{
res
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/kotlin/b/language/server/proBMangement/prob/ProBKernel.kt
+
28
−
32
View file @
dc961daf
...
@@ -8,10 +8,12 @@ import com.google.inject.Inject
...
@@ -8,10 +8,12 @@ import com.google.inject.Inject
import
com.google.inject.Injector
import
com.google.inject.Injector
import
de.prob.animator.ReusableAnimator
import
de.prob.animator.ReusableAnimator
import
de.prob.animator.command.CheckWellDefinednessCommand
import
de.prob.animator.command.CheckWellDefinednessCommand
import
de.prob.animator.command.GetMachineOperationInfos
import
de.prob.animator.domainobjects.ErrorItem
import
de.prob.animator.domainobjects.ErrorItem
import
de.prob.exception.ProBError
import
de.prob.exception.ProBError
import
de.prob.scripting.ClassicalBFactory
import
de.prob.scripting.ClassicalBFactory
import
de.prob.scripting.FactoryProvider
import
de.prob.scripting.FactoryProvider
import
de.prob.scripting.ModelFactory
import
de.prob.scripting.ModelTranslationError
import
de.prob.scripting.ModelTranslationError
import
de.prob.statespace.AnimationSelector
import
de.prob.statespace.AnimationSelector
import
de.prob.statespace.StateSpace
import
de.prob.statespace.StateSpace
...
@@ -49,26 +51,12 @@ class ProBKernel @Inject constructor(private val injector : Injector,
...
@@ -49,26 +51,12 @@ class ProBKernel @Inject constructor(private val injector : Injector,
animator
.
addWarningListener
(
informationListener
)
animator
.
addWarningListener
(
informationListener
)
Communicator
.
sendDebugMessage
(
"loading new machine"
,
MessageType
.
Info
)
Communicator
.
sendDebugMessage
(
"loading new machine"
,
MessageType
.
Info
)
val
errors
=
mutableListOf
<
ErrorItem
>()
val
strictProblems
=
loadMachine
(
val
problems
=
loadMachine
(
settings
,
path
,
factory
)
{
stateSpace
:
StateSpace
->
try
{
factory
.
extract
(
path
).
loadIntoStateSpace
(
stateSpace
)
}
catch
(
e
:
IOException
)
{
communicator
.
sendDebugMessage
(
"IOException ${e.message}"
,
MessageType
.
Info
)
}
catch
(
e
:
ModelTranslationError
)
{
communicator
.
sendDebugMessage
(
"ModelTranslationError ${e.message}"
,
MessageType
.
Info
)
}
catch
(
e
:
ProBError
){
errors
.
addAll
(
e
.
errors
)
}
Trace
(
stateSpace
)
},
settings
,
path
)
communicator
.
sendDebugMessage
(
"returning from kernel problems are ${
strictP
roblems.toString()}"
,
MessageType
.
Info
)
communicator
.
sendDebugMessage
(
"returning from kernel problems are ${
p
roblems.toString()}"
,
MessageType
.
Info
)
return
listOf
(
informationListener
.
getInformation
(),
strictProblems
,
convertErrorItems
(
errors
,
path
)
).
flatten
()
return
listOf
(
informationListener
.
getInformation
(),
problems
).
flatten
()
}
}
/**
/**
...
@@ -76,36 +64,44 @@ class ProBKernel @Inject constructor(private val injector : Injector,
...
@@ -76,36 +64,44 @@ class ProBKernel @Inject constructor(private val injector : Injector,
* @param newTraceCreator a anonymous function dealing with the state space
* @param newTraceCreator a anonymous function dealing with the state space
* @param settings the settings to be applied
* @param settings the settings to be applied
*/
*/
private
fun
loadMachine
(
newTraceCreator
:
java
.
util
.
function
.
Function
<
StateSpace
,
Trace
>,
settings
:
ProBSettings
,
private
fun
loadMachine
(
settings
:
ProBSettings
,
path
:
String
,
factory
:
ModelFactory
<
*
>):
List
<
Diagnostic
>
{
path
:
String
):
List
<
Diagnostic
>
{
communicator
.
sendDebugMessage
(
"creating new state space"
,
MessageType
.
Info
)
communicator
.
sendDebugMessage
(
"creating new state space"
,
MessageType
.
Info
)
val
newStateSpace
=
animator
.
createStateSpace
()
val
newStateSpace
=
animator
.
createStateSpace
()
communicator
.
sendDebugMessage
(
"setting preferences"
,
MessageType
.
Info
)
communicator
.
sendDebugMessage
(
"setting preferences"
,
MessageType
.
Info
)
newStateSpace
.
changePreferences
(
prepareAdditionalSettings
(
settings
))
newStateSpace
.
changePreferences
(
prepareAdditionalSettings
(
settings
))
val
errors
=
mutableListOf
<
ErrorItem
>()
val
errors
=
mutableListOf
<
ErrorItem
>()
try
{
try
{
communicator
.
sendDebugMessage
(
"changing animation"
,
MessageType
.
Info
)
factory
.
extract
(
path
).
loadIntoStateSpace
(
newStateSpace
)
animationSelector
.
changeCurrentAnimation
(
newTraceCreator
.
apply
(
newStateSpace
))
}
catch
(
e
:
IOException
)
{
communicator
.
sendDebugMessage
(
"done"
,
MessageType
.
Info
)
communicator
.
sendDebugMessage
(
"IOException ${e.message}"
,
MessageType
.
Info
)
}
catch
(
e
:
ModelTranslationError
)
{
communicator
.
sendDebugMessage
(
"ModelTranslationError ${e.message}"
,
MessageType
.
Info
)
}
catch
(
e
:
ProBError
){
errors
.
addAll
(
e
.
errors
)
}
communicator
.
sendDebugMessage
(
"executing optional steps"
,
MessageType
.
Info
)
if
(
errors
.
none
{
errorItem
->
errorItem
.
type
==
ErrorItem
.
Type
.
ERROR
})
{
executeAdditionalOptions
(
settings
)
communicator
.
sendDebugMessage
(
"No fatal errors found, continuing with option steps..."
,
MessageType
.
Info
)
if
(
settings
.
strictChecks
)
{
if
(
settings
.
strictChecks
)
{
errors
.
addAll
(
newStateSpace
.
performExtendedStaticChecks
())
errors
.
addAll
(
newStateSpace
.
performExtendedStaticChecks
())
}
}
communicator
.
sendDebugMessage
(
"finished evaluation"
,
MessageType
.
Info
)
try
{
communicator
.
sendDebugMessage
(
"executing optional steps"
,
MessageType
.
Info
)
executeAdditionalOptions
(
settings
)
}
catch
(
e
:
RuntimeException
)
{
}
catch
(
e
:
RuntimeException
)
{
communicator
.
sendDebugMessage
(
"something bad happened, statespace was killed"
,
MessageType
.
Warning
)
communicator
.
sendDebugMessage
(
"something bad happened, statespace was killed"
,
MessageType
.
Warning
)
newStateSpace
.
kill
()
newStateSpace
.
kill
()
throw
e
}
}
communicator
.
sendDebugMessage
(
"processing errors"
,
MessageType
.
Info
)
}
communicator
.
sendDebugMessage
(
"processing errors"
,
MessageType
.
Info
)
newStateSpace
.
kill
()
return
convertErrorItems
(
errors
,
path
)
return
convertErrorItems
(
errors
,
path
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment