microsoft / microsoft/language-server-protocol

How should paths containing things like .. (or differing cases) be handled?

Open
#669 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

clarification discussion document
Dominant language
TypeScript
Stars
13k
Forks
1k
Avg merge
6d 1h
Merged PRs (30d)
10

Description

If a client sends a URI to the server that contains dotted segments like file:///foo/bar/thing/../file.dart how should/must the server handle it? I believe it's a valid URI and could be treated the same as file:///foo/bar/file.dart, however clients may get confused if the URI we send back to them in things like publishDiagnostics doesn't seem to match the URIs they were sending us.

Can we assume it's fine for the server to normalise paths? Or can they be forbidden in the spec?

And along the same lines, but probably a huge can of worms - what about casing? If they send a URI where the casing doesn't match the case on disk (but they're on an case-insensitive file system), is it valid for us to send messages with differently-cased URIs (eg. if we get the path from another source, like a file system watcher, and it doesn't match)?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the protocol specification's URI guidance and trace the cases named in the issue: publishDiagnostics responses and URIs obtained from file-system watchers. Done means the specification documents an unambiguous rule for dotted segments, normalization, and casing, including whether clients may receive a URI that differs from the one they sent.

Written by the indexing model from the issue text.

Assessment

Domain
api, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.