Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Code intel. sometimes not supported on non-UTF8 files #32

Closed
beyang opened this issue Jan 11, 2018 · 5 comments
Closed

Code intel. sometimes not supported on non-UTF8 files #32

beyang opened this issue Jan 11, 2018 · 5 comments

Comments

@beyang
Copy link
Member

beyang commented Jan 11, 2018

New issue description by @slimsag:

Most language servers only support UTF8-encoded files, so code intelligence does not work on such files generally. It would be nice if we could have e.g. some intermediate layer convert all text files to UTF8 so that language servers only need to deal with UTF8 and things 'just work' for all non-UTF8 file encodings.


Old issue description:

"Just tried this out on some of our code bases. It appears to fail to generate snippets/highlights for all files that contain non-Unicode text, e.g. "Müller" in ISO-8859-1. Known issue?"

From https://news.ycombinator.com/reply?id=16124304

@beyang beyang added the bug An error, flaw or fault that produces an incorrect or unexpected result, or behavior. label Jan 26, 2018
@slimsag
Copy link
Member

slimsag commented May 30, 2018

It's not clear to me if this user was experiencing issues with viewing non-UTF8 files, or interacting with them.

  • If it was the former (viewing), then this issue is fixed.
  • If it was the latter (interacting), then the problem is much harder to solve. For example, language servers may need to convert text to UTF8 before interacting with it.

I will reword the issue description and tag this as a feature request to reflect point 2 above.

@slimsag slimsag changed the title Non-unicode files fail hovers and syntax highlighting Code intel. sometimes not supported on non-UTF8 files May 30, 2018
@slimsag slimsag added feature-request and removed bug An error, flaw or fault that produces an incorrect or unexpected result, or behavior. labels May 30, 2018
@felixfbecker
Copy link
Contributor

I don't think LSP has support for non-Unicode files at all - since it's JSON-based and text documents are transferred as JSON strings, doesn't it require all documents to be in Unicode? Afaik JSON strings are always Unicode (it may support non-UTF8 like UTF16 fine though, but not ISO-8859-1 as in the OP)

@slimsag
Copy link
Member

slimsag commented May 30, 2018

LSP is actually a bit funny about this, it transfers text as UTF8 but asks that ranges be measured in UTF16 codepoints: microsoft/language-server-protocol#376 (also in the spec if you search for utf).

But regardless, I certainly think we would not handle this at the LSP or langserver level. If anything, we could convert non-UTF8 documents to UTF8 prior to sending them to langservers --- but that would add a lot of complexity I am unsure we would even want.

I do not think this is worth looking into right now.

@beyang beyang added this to the Backlog milestone May 31, 2018
chrismwendt pushed a commit that referenced this issue Nov 4, 2018
* wip

feat: wip update phabricator to use codeintellify

* chore: rebased after refactor

* feat: support diffusion

* fix: remove log

* fix: toolbar logic

* chore: ran npm i

* refactor: rename types and add more docs

* refactor: use different syntax for function

* fix: github temporarily uses old codeviewtoolbar logic

* refactor: wip

* fix: lock file

* fix: tslint errors
@stale
Copy link

stale bot commented Mar 11, 2019

Please post an update or close this with an explanation if it is no longer relevant.
This will be closed automatically if there is no more activity.

@stale stale bot added the stale label Mar 11, 2019
@stale
Copy link

stale bot commented Apr 10, 2019

Stalebot is closing this due to inactivity.

@stale stale bot closed this as completed Apr 10, 2019
philipp-spiess added a commit that referenced this issue Apr 12, 2022
* Changelog update - v1.2.3

* Fixup CHANGELOG.md

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Philipp Spiess <[email protected]>
philipp-spiess added a commit that referenced this issue Apr 22, 2022
* Changelog update - v1.2.3

* Fixup CHANGELOG.md

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Philipp Spiess <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants