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

F# improvements #1573

Merged
merged 2 commits into from
Dec 1, 2018
Merged

Conversation

RunDevelopment
Copy link
Member

@RunDevelopment RunDevelopment commented Sep 24, 2018

This PR implements a few F# features:

  1. Attributes.
  2. Computation expressions (resolves F# computation expressions are not highlighted #1459).
  3. Class names for type annotations, casts (not including as), definitions and instancing (resolves F# type annotations are not highlighted #1460).
  4. Proper support for (nullable) operators.

Example

image
See for yourself!

private public rec return
return! select static struct
then to true try type
then to true try type;
Copy link
Member

Choose a reason for hiding this comment

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

Curious about these semicolons here. Are they syntactically correct for F#?

Copy link
Member

Choose a reason for hiding this comment

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

To rephrase, were the old code snippets wrong?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's because after type, inherit, etc. follow class names.
If that semicolon isn't there, the next keyword will be highlighted as a class name.

Copy link
Member

Choose a reason for hiding this comment

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

Worth adding a test that demonstrates this? Or do we have one for that?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure we have! class-name_feature.test

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

Successfully merging this pull request may close these issues.

F# type annotations are not highlighted F# computation expressions are not highlighted
2 participants