我已經編寫了一個基於Xtext的插件,該工具在我的工作區中的其中一個項目中打開文件時效果很好;然而,當我打開一個文件工作區外(通過文件 - >打開文件...),某些功能無法正常工作:基於Xtext的編輯器的某些功能在項目外的文件上不起作用
- 我得到語法着色,但我不明白的語法錯誤。
- Quickfix選項不起作用,可能是因爲
context.getXtextDocument()
返回null
,我依靠它來做我的quickfix建議。
可能還有其他一些我缺少的東西,但大多數其他功能,如內容輔助,懸停定義,出現標記等,都可以正常工作。
有沒有辦法讓工作區的外部源文件與內部文件的行爲相同?另外,是否有一種解決方法,可以讓我「哄騙」Xtext,以某種方式說服該文件是當前項目的內部文件,例如通過以編程方式創建項目的鏈接?
This is a related question about the behavior with a workspace-external file,但是我成功打開這些文件就好了,只是有些功能無法正常工作。
解決方法似乎運作良好,謝謝! – Oak 2013-03-13 08:12:09