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

Add features for the Statemachine example #1257

Open
7 tasks
Tracked by #295
pluralia opened this issue Nov 2, 2023 · 3 comments · May be fixed by #1265
Open
7 tasks
Tracked by #295

Add features for the Statemachine example #1257

pluralia opened this issue Nov 2, 2023 · 3 comments · May be fixed by #1265
Labels
examples Issue about one of the included example packages good first issue Good for newcomers LSP Language Server Protocol integration validation Validation related issue

Comments

@pluralia
Copy link
Contributor

pluralia commented Nov 2, 2023

  • validation

    • Validate unreachable states
    • Validate unused events
  • code actions

    • If a state name doesn't start with a capital letter, replace it with capitalized name (look at the corresponding validation here)
    • Remove an unreachable state
    • Remove an unused event
  • LSP

    • Formatter
    • RenameProvider
@pluralia pluralia added good first issue Good for newcomers validation Validation related issue examples Issue about one of the included example packages LSP Language Server Protocol integration labels Nov 2, 2023
@Yokozuna59
Copy link
Contributor

Hi @pluralia,

I plan to work on this if it's possible, but I've few questions:

  1. On the first code actions:

    If a state name doesn't start with a capital letter, replace it with capitalized name (look at the corresponding validation here)

    The action should also update everywhere the state has been used, shouldn't it?

  2. Do we actually need to override RenameProvider? It's working fine:

    Screencast.from.2023-11-04.15-02-12.webm
  3. Should we also validate commands uniqueness and usage? Currently, it's possible to have duplicate command names within commands, states, and events.

@msujew
Copy link
Contributor

msujew commented Nov 4, 2023

@Yokozuna59

The action should also update everywhere the state has been used, shouldn't it?

Yes, it should work similar to the rename LSP feature in that regard.

Do we actually need to override RenameProvider? It's working fine:

It was probably added in error, I don't think it's necessary.

Should we also validate commands uniqueness and usage? Currently, it's possible to have duplicate command names within commands, states, and events.

Yep, that would be good 👍

@Yokozuna59
Copy link
Contributor

@msujew Thanks for the feedback. I'm almost done, but the formatting is kind of performing some of the expected behaviors. For example, the following format code:

formatter.keyword('initialState')
    .prepend(Formatting.fit(Formatting.newLine({ allowMore: true }), /* another rule */))
    .append(Formatting.oneSpace());

It formats the previous lines and makes them one, although it has allowMore. If I remove the Formatting.fit, it doesn't do that.

I tried to add and remove another rule in Formatting.fit, but it's performing the same behavior.

@Yokozuna59 Yokozuna59 linked a pull request Nov 4, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples Issue about one of the included example packages good first issue Good for newcomers LSP Language Server Protocol integration validation Validation related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants