removing squigglelineindicator

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by Paul Huckstepp - UK
Avatar
Two questions have arisen after recently putting together the starts of a spell checking routine for my implementation of SyntaxEditor.

Firstly, I'm using the example for the VB test application to create a new indicator for underlining spelling errors with a red squiggly line, which works very nicely, however I cannot work out how to remove the indicator if I use the backspace key to correct the spelling error, i.e. After typing 'songsand' I then place the caret at the end of the word and delete back to change the word to 'songs', I then press space and the word is rechecked and deemed to be correct, however I cannot work out how to remove the underline.

Secondly, My spell checking routine is able to determine between HTML, code and plain text so that only strings outside of any code and HTML tags is checked, I would like to extend this to include string definitions within code, specifically javascript "string" 'string' and ASP/VBScript "strings" but it seems that the token for such strings is actually everything between the string identifiers, so that 'string' and 'lots of strings' are detected as a single token. Is it possible to seperate these out as seperate tokens/words like the lixical state 'DefaultState' in HTML or will I need to parse them manually some how?

Thanks for your help

Comments (3)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Paul,

The DocumentLine.Indicators property lists all the indicators on a line. Once you know which one to remove, call the Document.Indicators.Remove method and pass it as a parameter.

You can modify the language def to split up the words in HTML attribute strings. Just do what we did elsewhere.

Speaking of spell checking, this is something that we wanted to support better. If you have suggestions for how to implement it, please let me know. The problem is that "words" can be different from "tokens". So do we spell check by word or token? Also you want to filter out certain states or pattern groups. But those are tied to tokens, not words. Any suggestions are welcome.


Actipro Software Support

Posted 14 years ago by Paul Huckstepp - UK
Avatar
The problem is if say 10 words on a line has an indicator called 'spelling error', do I need to give each spelling error a unique indentifier to remove it from the line?


The way I'm implementing the spellchecking is by using a third party spelling component called polar spellchecker activeX DLL, this allows me to scan each token with a lexical state of DefaultState in a language of HTML and check its spelling. I then overid the contextmenu to display a list of suggestions. The integration the component recommends doesn't work with SyntaxEditor so you have to code the scanning routines yourself but SyntaxEditor makes that nice and easy <IMG SRC="smile.gif" border="0">

It would be much easier if you could get either tokens, or words. Words could then be used to check spelling, and each word could be given properties so that you could determine whether it was plaintext or not, i.e. is it part of the language construct or a string etc.
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
You remove indicators by references to their instances so if you determine which one needs to be removed, you just pass that to the Remove method.

A recommendation is use the TextStream for scanning words. It has methods that navigate between words.

The only issue with spell-checking by word is that it is possible (depending on your language design and probably unlikely) for a word to cross lexical state or token boundaries.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.