Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Wrong coloring under php #345

Closed
CptAdamica opened this issue Nov 28, 2018 · 4 comments
Closed

Wrong coloring under php #345

CptAdamica opened this issue Nov 28, 2018 · 4 comments

Comments

@CptAdamica
Copy link

Description

It often spoils the color of long lines.

sample.txt

Steps to Reproduce

  1. Open sample.txt and change file format to php
  2. Wrong coloring on line four end

Expected behavior: Correct coloring

Actual behavior: Wrong coloring

Reproduces how often: 100%

Versions

Atom : 1.32.2
Electron: 2.0.9
Chrome : 61.0.3163.100
Node : 8.9.3

apm 2.1.2
npm 6.2.0
node 8.9.3 x64
atom 1.32.2
python
git 2.11.0.windows.1
visual studio

@thomasjo
Copy link

Upon testing this, the problem seems to be related to expression like $_SESSION['t_id'][$i].
As soon as I remove the second subscript operator ([]) from the relevant terms in the shared example code, the rest of the line is parsed correctly.

Looks like the grammar does not currently support multiple levels of subscript operators?

@50Wliu: I wasn't able to find any existing issue related to this. Is this a known, but not reported issue? Perhaps my testing/assumptions are not correct.

@Ingramz
Copy link
Contributor

Ingramz commented Nov 28, 2018

I think it is another case of hitting the token render limit of editor. The file is actually parsed correctly, just that after a number of tokens the rest of the line is styled by the last processed token. atom/atom#1667

@thomasjo
Copy link

@Ingramz Yeah, you're totally correct. Thanks!

@sanada01 Looks like you're hitting the problem with token limits in the old first-mate grammars, which you can read more about in atom/atom#1667. The good news is that the introduction of the new Tree-sitter grammars resolves this problem; see atom/atom#1667 (comment).

Unfortunately this package does not yet have a Tree-sitter grammar, but work has started and you can track the progress in #303. You might want to sign up for updates there.

Because this issue will be resolved once #303 is merged, I'm going to close this issue.
Thanks again for your report!

@CptAdamica
Copy link
Author

@Ingramz Yeah, you're totally correct. Thanks!

@sanada01 Looks like you're hitting the problem with token limits in the old first-mate grammars, which you can read more about in atom/atom#1667. The good news is that the introduction of the new Tree-sitter grammars resolves this problem; see atom/atom#1667 (comment).

Unfortunately this package does not yet have a Tree-sitter grammar, but work has started and you can track the progress in #303. You might want to sign up for updates there.

Because this issue will be resolved once #303 is merged, I'm going to close this issue.
Thanks again for your report!

Thanks! :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants