How to find string line where cursor is

Answered

I have offset PlatformDataKeys.EDITOR.getData(e.dataContext).caretModel.offset that gives me offset from the beginning of the file.

I have val xmlFile = PsiManager.getInstance(project).findFile(file!!) as XmlFile.

How to use both of them to get the word or element where the cursor is and element?

 

0

Please sign in to leave a comment.