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

feat: Typst Language Support #302

Open
wants to merge 44 commits into
base: master
Choose a base branch
from

Conversation

grantlemons
Copy link
Contributor

@grantlemons grantlemons commented Dec 4, 2024

Re-opening of #289 from my fork instead of a branch

@grantlemons
Copy link
Contributor Author

grantlemons commented Dec 18, 2024

Mostly just needs more tests. I'm no expert in Typst syntax, so if someone wants to help it would be much appreciated.

@Andrew15-5
Copy link

If I can understand the core concepts mentioned above (what should/could be checked), then I maybe be able to add some tests.

…non-mut

The parser trait's parse method took an &mut, but it wasn't used
anywhere and was causing significant problems interacting with closures.

If it is needed in the future, I would suggest creating a seperate
mutable parse method.
@grantlemons grantlemons marked this pull request as ready for review December 29, 2024 04:08
@grantlemons grantlemons marked this pull request as draft December 29, 2024 18:21
Copy link
Collaborator

@elijah-potter elijah-potter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I have some questions.

harper-cli/src/main.rs Outdated Show resolved Hide resolved
harper-tree-sitter/src/lib.rs Show resolved Hide resolved
harper-core/Cargo.toml Outdated Show resolved Hide resolved
harper-core/src/mask/mod.rs Show resolved Hide resolved
@@ -284,6 +284,12 @@ impl Document {
}

let child_tok = &copy[cursor];

// Only condense adjacent spans
if start_tok.span.end != child_tok.span.start {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this change to condense_newlines as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did that originally, but it broke a test so I reverted it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test might be wrong then.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, it's because newlines in comments need to be merged for paragraph breaks.

// I am a comment
//
// My span starts after the //

There is no paragraph break in between because the newline on line 2's span isn't contiguous with the newline at the end of line 1.

This reverts part of commit b61c78c.
The portion reverted is the default hiding of newlines in the span
command, which has been relocated to a new branch
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

Successfully merging this pull request may close these issues.

3 participants