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

[23] Folding a markdown region hides the first line of subsequent Java code #1615

Open
stephan-herrmann opened this issue Aug 27, 2024 · 8 comments
Assignees
Milestone

Comments

@stephan-herrmann
Copy link
Contributor

Given

	///
	/// This is the comment of m()
	///
	void m() {
		System.out.println("m");
	}

when you fold the markdown comment in the editor, it looks like this:

image

@jarthana looks like your latest change in #1549 only moved the problem :)

@stephan-herrmann
Copy link
Contributor Author

@jarthana have you seen this?

@jarthana
Copy link
Member

jarthana commented Sep 9, 2024

@jarthana have you seen this?

Thanks, will take a look.

@jarthana
Copy link
Member

jarthana commented Sep 9, 2024

Actually, I don't see fold/unfold option at all for markdown comments. Sigh! Let me see what's going on.

@jarthana
Copy link
Member

jarthana commented Sep 9, 2024

Actually, I don't see fold/unfold option at all for markdown comments. Sigh! Let me see what's going on.

This turned out to be the result of making the feature standard feature. Without that patch, the markdown folds/unfolds well.

Anyway, I am unable to see the problem. @stephan-herrmann Can you please check now?

@stephan-herrmann
Copy link
Contributor Author

This turned out to be the result of making the feature standard feature. Without that patch, the markdown folds/unfolds well.

Wow, for preview features, isSupported() only checks that flag, ignoring the compliance / source levels. As a standard feature we check compliance, but org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.fSharedScanner uses JavaCore's default compliance level, ignoring what might be configured per project.

Sharing a scanner seems to be incompatible with version-dependent scanning :-(

@stephan-herrmann
Copy link
Contributor Author

Anyway, I am unable to see the problem. @stephan-herrmann Can you please check now?

When setting the workspace default compliance to 23 I can still see the same problem as before.

@jarthana Here's the difference: I normally use unix line-ends. When I change this to windows line-ends, folding is correct. Conversely, you should be able to see the bug when switching to unix line-ends.

Does this help to find some off-by-one bug?

@jarthana
Copy link
Member

Wow, for preview features, isSupported() only checks that flag, ignoring the compliance / source levels. As a standard feature we check compliance, but org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.fSharedScanner uses JavaCore's default compliance level, ignoring what might be configured per project.

Yeah, that is written based on the assumption that preview can only be enabled when the compliance is the highest. That works within the compiler but as it turns out, not all clients follow that rule.

@jarthana
Copy link
Member

jarthana commented Sep 11, 2024

Anyway, I am unable to see the problem. @stephan-herrmann Can you please check now?

When setting the workspace default compliance to 23 I can still see the same problem as before.

@jarthana Here's the difference: I normally use unix line-ends. When I change this to windows line-ends, folding is correct. Conversely, you should be able to see the bug when switching to unix line-ends.

Does this help to find some off-by-one bug?

Reproduced. Thanks for the tip!

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

No branches or pull requests

2 participants