Skip to content

Commit 6ed04c1

Browse files
committed
make configs work on linux
1 parent a2db211 commit 6ed04c1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

mypy_ls/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.3.5"
1+
__version__ = "0.3.6"

mypy_ls/plugin.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ def init(workspace: str) -> Dict[str, str]:
178178
The plugin config dict.
179179
180180
"""
181+
# On windows the path contains \\ on linux it contains / all the code works with /
182+
workspace = workspace.replace("\\", "/")
181183
configuration = {}
182184
path = findConfigFile(workspace, "mypy-ls.cfg")
183185
if path:
@@ -214,11 +216,11 @@ def findConfigFile(path: str, name: str) -> Optional[str]:
214216
215217
"""
216218
while True:
217-
p = f"{path}\\{name}"
219+
p = f"{path}/{name}"
218220
if os.path.isfile(p):
219221
return p
220222
else:
221-
loc = path.rfind("\\")
223+
loc = path.rfind("/")
222224
if loc == -1:
223225
return None
224226
path = path[:loc]

0 commit comments

Comments
 (0)