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(dashboard): RP-7206 spell checker with typo-js #4

Open
wants to merge 5 commits into
base: multiline-0.49.0
Choose a base branch
from

Conversation

itainaor-arpeely
Copy link

@itainaor-arpeely itainaor-arpeely commented Dec 9, 2024

  1. Change package.json path for monaco-editor to: file:../../../../monaco-editor, and run pnpm install.
  2. Put inside src/assets/static/typo-js/en_US the attached files
    aff&dic.zip
Screenshot 2024-12-15 at 9 48 20

@itainaor-arpeely itainaor-arpeely requested a review from a team December 10, 2024 11:34
Comment on lines 3623 to 3641
var cumulativeLength = specialCharsBeforeLength;

var spellResults = words.reduce((acc, word, index) => {
if (isNaN(word) && !dictionary.check(word)) {
var wordStartPosition = scanner.getTokenOffset() + cumulativeLength + 1;
var wordEndPosition = wordStartPosition + word.length

acc.push({
word,
suggestions: [],
start: wordStartPosition,
end: wordEndPosition
});
}

cumulativeLength += word.length + (delimiters.length > index ? delimiters[index].length : 0);

return acc;
}, []);
Copy link

@OfirTadmor OfirTadmor Dec 12, 2024

Choose a reason for hiding this comment

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

I think it's a bad practice to mutate from inside a reduce (we can pass the cumulativeLength as the part of the acc variable instead )

@molotbar molotbar changed the title feat(dashboard): spell checker with typo-js feat(dashboard): RP-7206 spell checker with typo-js Dec 15, 2024
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.

2 participants