Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextMate syntax coloring doesn't appear on first toggle split editor #827

Open
sdaimwood opened this issue Nov 5, 2024 · 10 comments
Open

Comments

@sdaimwood
Copy link

Our organization maintains several language servers that use TM4E in an eclipse-based product. We've had customer reports and verified that when first using the Toggle Split Editor view, the newly opened window does not highlight until it is toggled on a second time.

Using the publicly available YAML editor as an example:

  1. Open YAML source in the YAML Editor with Window/Editor/Toggle
    Split Editor (Vertical).
    The new second window will have no syntax highlighting.

  2. Without closing, use same YAML source with Window/Editor/Toggle Split Editor
    (Horizontal).
    The new horizontally split window does have syntax highlighting.

  3. Use same YAML source with Window/Editor/Toggle Split Editor
    (Vertical).
    The new vertically split screen will have syntax highlighting.

It appears that for each file, only the first invocation of split screen editing doesn't have highlighting, but every following invocation does.

Environment:

  • Eclipse 4.31
  • TM4E 0.13.0, LSP4E 0.18.4
@sebthom sebthom added the bug label Nov 6, 2024
@sebthom
Copy link
Member

sebthom commented Nov 6, 2024

I can reproduce this with the latest eclipse and tm4e release.

@mickaelistria any idea how to address this?

@sebthom
Copy link
Member

sebthom commented Feb 2, 2025

I cannot reproduce this anymore with Eclipse 2024-12 (4.34.0) and TM4E 0.14.1.

Feel free to reopen if issue persists.

@sebthom sebthom closed this as completed Feb 2, 2025
@sdaimwood
Copy link
Author

Thanks for the update, unfortunately I'm still seeing this running Eclipse 4.34 and TM4E 0.14.1, was running 0.14.0 and even updated to double check.

@sdaimwood
Copy link
Author

sdaimwood commented Feb 5, 2025

@sebthom I am on macOS if that makes a difference, but have had colleagues test on Windows as well and still seeing the same issue. Unfortunately I'm not able to reopen with the repository's current permissions setup.

@sebthom
Copy link
Member

sebthom commented Feb 5, 2025

I downloaded/extracted/run vanilla eclipse-java-2024-12-R-win32-x86_64.zip on Windows 10.
The error is not reproducible for me. So even if we reopen I don't see this to be actionable.

Here is a screen recording:
Image

@sdaimwood
Copy link
Author

Very odd. Here's what I'm seeing.

Image

Just tested on a Windows 10 VM after a fresh install of vanilla 2024-12 and seeing the issue there still as well. Do you have any idea what I might be missing in an environment config?

@sebthom
Copy link
Member

sebthom commented Feb 5, 2025

Can you try with this Eclipse bundle? https://www.eclipse.org/downloads/packages/release/2024-12/r/eclipse-ide-java-developers

Maybe some plugin from the RCP/RAP bundle is interfering.

Also try to use a fresh/empty workspace (in case you haven't done so).

If you are using a VM. Is the project on a shared folder or on the local drive inside the VM?

@sdaimwood
Copy link
Author

sdaimwood commented Feb 5, 2025

This is interesting, I had no luck with that eclipse as well as a brand new workspace on mac. Tried the same on the Windows VM, no change. However, I changed my yaml file contents to match what you have in your yaml, and it works...

Could you try matching the following yaml contents to see what happens?

# yaml-language-server: $schema=
name: no-name
test: this-one

@sebthom sebthom reopened this Feb 5, 2025
@sebthom
Copy link
Member

sebthom commented Feb 5, 2025

That is surprising.

Minimal reproducible for me is:

key: value

Like this it works as expected:

key:
  value

@sdaimwood
Copy link
Author

That is surprising.

Minimal reproducible for me is:

key: value
Like this it works as expected:

key:
value

I tested this using our language server and textmate, and it doesn't seem to be directly related to whitespace usage. Perhaps something with different rules getting hit in the textmate?

We're also working on implementing semantic tokens support, and with semantic tokens the highlighting does work the first time the split editor is toggled. So that is somewhat of a workaround.

oleosterhagen added a commit to oleosterhagen/tm4e that referenced this issue Mar 2, 2025
For new models the colorizer will be invoked after tokenization. For
reused models (e.g. when splitting an editor) this must be done
explicitly.
oleosterhagen added a commit to oleosterhagen/tm4e that referenced this issue Mar 2, 2025


For new models the colorizer will be invoked after tokenization. For
reused models (e.g. when splitting an editor) this must be done
explicitly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants