mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-16 05:25:21 +02:00
Bug 541117 - NPE in CElementHyperlinkDetector.isLanguageKeyword
Change-Id: I4bd2155de5aa7a09cb9e68f57e1168bdaab76401
This commit is contained in:
parent
0c7b32c0dd
commit
ac68d83566
1 changed files with 8 additions and 6 deletions
|
@ -206,12 +206,14 @@ public class CElementHyperlinkDetector extends AbstractHyperlinkDetector {
|
|||
*/
|
||||
private static IRegion getIdentifier(IDocument document, int offset, ILanguage language)
|
||||
throws BadLocationException {
|
||||
IRegion wordRegion = CWordFinder.findWord(document, offset);
|
||||
if (wordRegion != null && wordRegion.getLength() > 0) {
|
||||
String word = document.get(wordRegion.getOffset(), wordRegion.getLength());
|
||||
if (!Character.isDigit(word.charAt(0))) {
|
||||
if (SemanticUtil.isAutoOrDecltype(word) || !isLanguageKeyword(language, word)) {
|
||||
return wordRegion;
|
||||
if (language != null) {
|
||||
IRegion wordRegion = CWordFinder.findWord(document, offset);
|
||||
if (wordRegion != null && wordRegion.getLength() > 0) {
|
||||
String word = document.get(wordRegion.getOffset(), wordRegion.getLength());
|
||||
if (!Character.isDigit(word.charAt(0))) {
|
||||
if (SemanticUtil.isAutoOrDecltype(word) || !isLanguageKeyword(language, word)) {
|
||||
return wordRegion;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue