Skip to content

Commit

Permalink
check for mypy.ini too
Browse files Browse the repository at this point in the history
  • Loading branch information
jwhitaker-gridcog committed Aug 20, 2024
1 parent f60ecd8 commit 8b68a2c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bundled/tool/lsp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,9 +658,12 @@ def get_cwd(settings: Dict[str, Any], document: Optional[workspace.Document]) ->
# until we leave the workspace
while candidate.is_relative_to(workspaceFolder):
# check if pyproject exists
if (candidate / "pyproject.toml").is_file():
log_to_output(f"found pyproject in {candidate}", lsp.MessageType.Debug)
return os.fspath(candidate)
check_for = ["project.toml", "mypy.ini"]
for n in check_for:
candidate_file = candidate / n
if candidate_file.is_file():
log_to_output(f"found {n}, using {candidate}", lsp.MessageType.Debug)
return os.fspath(candidate)
# starting from the current file and working our way up
else:
candidate = candidate.parent
Expand Down

0 comments on commit 8b68a2c

Please sign in to comment.