Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Fixed zero files for Stylus
Browse files Browse the repository at this point in the history
  • Loading branch information
Anantachai Saothong (Manta) committed Jul 18, 2018
1 parent 892e415 commit 197a1fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### 2.0.0
- Amended interchangeability of JavaScript and TypeScript.
- Amended identifier resolution in JavaScript and TypeScript.
- Fixed zero files for Stylus.

### 1.4.0
- Amended picking the closest `package.json` from the current active document.
Expand Down
18 changes: 8 additions & 10 deletions edge/Stylus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export interface LanguageOptions {
semiColons: boolean
}

const SUPPORTED_LANGUAGE = /^stylus$/

export default class Stylus implements Language {
private baseConfig: RootConfigurations
private fileItemCache: Array<FileItem>
Expand All @@ -38,16 +40,14 @@ export default class Stylus implements Language {
.map(fileLink => new FileItem(new FileInfo(fileLink.fsPath), rootPath, this.baseConfig.stylus))
}

let items: Array<Item> = _.chain(this.fileItemCache)
return _.chain(this.fileItemCache)
.reject(item => item.fileInfo.fullPath === documentFileInfo.fullPath) // Remove the current file
.forEach(item => item.sortablePath = getSortablePath(item.fileInfo, documentFileInfo))
.value()
items = _.sortBy([ // Sort files by their path and name
item => item.sortablePath,
item => item.sortableName,
]) as any as Array<Item>

return items
.sortBy([ // Sort files by their path and name
item => item.sortablePath,
item => item.sortableName,
])
.value() as Array<Item>
}

addItem(filePath: string) {
Expand Down Expand Up @@ -265,8 +265,6 @@ class FileItem implements Item {
}
}

const SUPPORTED_LANGUAGE = /^stylus$/

function getExistingImportsAndUrls(node: any, visitedNodes = new Set()) {
if (visitedNodes.has(node)) {
return []
Expand Down

0 comments on commit 197a1fd

Please sign in to comment.