Skip to content

Commit

Permalink
add license and remove nimble file
Browse files Browse the repository at this point in the history
  • Loading branch information
bung87 committed Sep 12, 2023
1 parent 442b344 commit 48eb265
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 42 deletions.
21 changes: 21 additions & 0 deletions nimlsp/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 PMunch

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 1 addition & 17 deletions nimlsp/nimlsp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ include nimlsppkg/[messages, messageenums]


const
version = block:
var version = "0.0.0"
let nimbleFile = staticRead(currentSourcePath().parentDir / "nimlsp.nimble")
for line in nimbleFile.splitLines:
let keyval = line.split('=')
if keyval.len == 2:
if keyval[0].strip == "version":
version = keyval[1].strip(chars = Whitespace + {'"'})
break
version
# This is used to explicitly set the default source path
explicitSourcePath {.strdefine.} = getCurrentCompilerExe().parentDir.parentDir

Expand Down Expand Up @@ -617,7 +607,6 @@ proc main(ins: Stream, outs: Stream) =
continue

when isMainModule:
infoLog("Version: ", version)
infoLog("explicitSourcePath: ", explicitSourcePath)
for i in 1..paramCount():
infoLog("Argument ", i, ": ", paramStr(i))
Expand All @@ -626,14 +615,9 @@ when isMainModule:
of "--help":
echo "Usage: nimlsp [OPTION | PATH]\n"
echo "--help, shows this message"
echo "--version, shows only the version"
echo "PATH, path to the Nim source directory, defaults to \"", nimpath, "\""
quit 0
of "--version":
echo "nimlsp v", version
when defined(debugLogging): echo "Compiled with debug logging"
when defined(debugCommunication): echo "Compiled with communication logging"
quit 0

else: nimpath = expandFilename(paramStr(1))
if not fileExists(nimpath / "config/nim.cfg"):
stderr.write &"""Unable to find "config/nim.cfg" in "{nimpath
Expand Down
25 changes: 0 additions & 25 deletions nimlsp/nimlsp.nimble

This file was deleted.

0 comments on commit 48eb265

Please sign in to comment.