-
Notifications
You must be signed in to change notification settings - Fork 20
Language Server Protocol Experiments #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
3432c5b
8c57afe
6976b00
34576ab
86198ab
6c8a490
bb641fe
0afbf4d
cc3d58a
3b76bb9
a7c9594
4dbcc6d
15f9659
37b18ce
ca81506
974167d
3cd97ec
f448a37
ed4c88c
d34c480
5bff531
47a0a54
cfbb6d7
40ce180
e40a810
0ee3320
26f196b
af36258
1cf1c29
fd0ccfe
0951f49
23af333
c3f8515
097859d
eb274f8
751138d
6967158
54f4b31
b78c7bd
8d20499
d181e16
faf31a8
f0db3c1
0335bb9
a1ffbf3
811449a
dcf06cb
4c69c54
892a90d
162954f
8ff5e9c
8cc4886
711b149
718f47f
a05a1eb
7c0551d
75e4f26
cd2ab17
b1f7a05
04fb6fb
f12b734
1f1e123
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| version = "2.6.4" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| // Use IntelliSense to learn about possible attributes. | ||
| // Hover to view descriptions of existing attributes. | ||
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "type": "scala", | ||
| "name": "Debug", | ||
| "request": "launch", | ||
| "mainClass": "millfork.Main", | ||
| // optional jvm properties to use | ||
| "jvmOptions": [], | ||
| "args": [] | ||
| }, | ||
|
|
||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "files.watcherExclude": { | ||
| "**/target": true | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| // See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
| // for the documentation about the tasks.json format | ||
| "version": "2.0.0", | ||
| "tasks": [ | ||
| { | ||
| "label": "Compile Millfork", | ||
| "type": "shell", | ||
| "command": "sbt -DskipTests=true compile && sbt -DskipTests=true assembly", | ||
| "problemMatcher": [], | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": true | ||
| } | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| sbt.version = 0.13.18 | ||
| sbt.version = 1.4.0 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any idea what this changes? I was having issues getting my tooling to work due to mixed versions of Scala, so I upgraded SBT.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess a newer SBT shouldn't hurt, as long as it works. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| // DO NOT EDIT! This file is auto-generated. | ||
| // This file enables sbt-bloop to create bloop config files. | ||
|
|
||
| addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.4-13-408f4d80") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| // DO NOT EDIT! This file is auto-generated. | ||
| // This file enables sbt-bloop to create bloop config files. | ||
|
|
||
| addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.4-13-408f4d80") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| // DO NOT EDIT! This file is auto-generated. | ||
| // This file enables sbt-bloop to create bloop config files. | ||
|
|
||
| addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.4-13-408f4d80") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| package millfork.cli | ||
|
|
||
| import net.liftweb.json._ | ||
| import java.nio.file.Files | ||
| import java.nio.file.Paths | ||
| import java.nio.charset.StandardCharsets | ||
| import scala.collection.mutable | ||
| import scala.collection.convert.ImplicitConversionsToScala._ | ||
| import java.io.InputStreamReader | ||
| import millfork.Context | ||
| import millfork.error.ConsoleLogger | ||
|
|
||
| case class JsonConfig( | ||
| include: Option[List[String]], | ||
| platform: Option[String], | ||
| inputFiles: Option[List[String]] | ||
| ) | ||
|
|
||
| object JsonConfigParser { | ||
| implicit val formats = DefaultFormats | ||
|
|
||
| def parseConfig(context: Context, logger: ConsoleLogger): Context = { | ||
| var newContext = context | ||
|
|
||
| var defaultConfig = false | ||
| val filePath = context.configFilePath.getOrElse({ | ||
| defaultConfig = true | ||
| ".millforkrc.json" | ||
| }) | ||
|
|
||
| val path = Paths.get(filePath) | ||
|
|
||
| try { | ||
| val jsonString = | ||
| Files | ||
| .readAllLines(path, StandardCharsets.UTF_8) | ||
| .toIndexedSeq | ||
| .mkString("") | ||
|
|
||
| val result = parse(jsonString).extract[JsonConfig] | ||
|
|
||
| if (context.inputFileNames.length < 1 && result.inputFiles.isDefined) { | ||
| newContext = newContext.copy(inputFileNames = result.inputFiles.get) | ||
| } | ||
|
|
||
| if (context.includePath.length < 1 && result.include.isDefined) { | ||
| newContext = | ||
| newContext.copy(extraIncludePath = result.include.get.toSeq) | ||
| } | ||
|
|
||
| if (context.platform.isEmpty && result.platform.isDefined) { | ||
| newContext = newContext.copy(platform = Some(result.platform.get)) | ||
| } | ||
| } catch { | ||
| case default: Throwable => { | ||
| if (!defaultConfig) { | ||
| // Only throw error if not default config | ||
| logger.fatalQuit("Invalid config file") | ||
| } | ||
| } | ||
| } | ||
|
|
||
| newContext | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.