Skip to content

Commit

Permalink
Get configuration from tsconfig.json
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffrey-easyesi committed Jul 29, 2015
1 parent c2b41fc commit ec0b07b
Show file tree
Hide file tree
Showing 4 changed files with 451 additions and 21 deletions.
3 changes: 2 additions & 1 deletion src/netbeanstypescript/TSIndexerFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public CustomIndexer createIndexer() {
protected void index(Iterable<? extends Indexable> itrbl, Context cntxt) {
for (Indexable indxbl: itrbl) {
FileObject fo = cntxt.getRoot().getFileObject(indxbl.getRelativePath());
if (fo != null && "text/typescript".equals(FileUtil.getMIMEType(fo))) {
if (fo != null && ("text/typescript".equals(FileUtil.getMIMEType(fo))
|| fo.getNameExt().equals("tsconfig.json"))) {
TSService.INSTANCE.addFile(Source.create(fo).createSnapshot(), indxbl, cntxt);
}
}
Expand Down
11 changes: 5 additions & 6 deletions src/netbeanstypescript/TSService.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ synchronized void scanFinished(Context context) {
ErrorsCache.setErrors(context.getRootURI(), i, errors, new Convertor<JSONObject>() {
@Override
public ErrorsCache.ErrorKind getKind(JSONObject err) {
int code = ((Number) err.get("code")).intValue();
if (code >= 7000 && code <= 7999) {
int category = ((Number) err.get("category")).intValue();
if (category == 0) {
return ErrorsCache.ErrorKind.WARNING;
} else {
return ErrorsCache.ErrorKind.ERROR;
Expand Down Expand Up @@ -365,12 +365,11 @@ synchronized List<DefaultError> getDiagnostics(Snapshot snapshot) {
int start = ((Number) err.get("start")).intValue();
int length = ((Number) err.get("length")).intValue();
String messageText = (String) err.get("messageText");
//int category = ((Number) err.get("category")).intValue();
int code = ((Number) err.get("code")).intValue();
int category = ((Number) err.get("category")).intValue();
//int code = ((Number) err.get("code")).intValue();
errors.add(new DefaultError(null, messageText, null,
fo, start, start + length, false,
// 7xxx is implicit-any errors
(code >= 7000 && code <= 7999) ? Severity.WARNING : Severity.ERROR));
category == 0 ? Severity.WARNING : Severity.ERROR));
}
return errors;
}
Expand Down
Loading

0 comments on commit ec0b07b

Please sign in to comment.