mirror of
https://github.com/James-Yu/LaTeX-Workshop.git
synced 2024-10-04 07:07:54 +03:00
Synchronously read autocomplete related files
This commit is contained in:
parent
5df5343a60
commit
6de40d8097
@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [0.1.2] - 2017-01-03
|
||||
### Changed
|
||||
- Synchronously read related files when developing citation and reference autocompletes.
|
||||
- The original acynchronous pattern will miss the latest changes.
|
||||
- If the autocomplete reaction speed is greatly influenced in large files, this change may be reverted.
|
||||
|
||||
## [0.1.1] - 2017-01-01
|
||||
### Added
|
||||
- An extension icon.
|
||||
|
BIN
img/icon.png
BIN
img/icon.png
Binary file not shown.
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 10 KiB |
@ -3,7 +3,7 @@
|
||||
"displayName": "LaTeX Workshop",
|
||||
"description": "AIO LaTeX extension to preview, compile, autocomplete, and more.",
|
||||
"icon": "img/icon.png",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"publisher": "James-Yu",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/James-Yu/LaTeX-Workshop",
|
||||
|
@ -24,17 +24,9 @@ export function find_citation_keys() {
|
||||
while (bib = reg.exec(text)) {
|
||||
var file = path.join(path.dirname(vscode.window.activeTextEditor.document.uri.fsPath), path.basename(bib[1], '.bib') + '.bib')
|
||||
if (!fs.existsSync(file)) continue;
|
||||
if (latex_data.get_citation_keys().length == 0) {
|
||||
var buffer = fs.readFileSync(file);
|
||||
parse_keys(buffer);
|
||||
latex_data.set_citation_keys(keys);
|
||||
} else {
|
||||
fs.readFile(file, (err, data) => {
|
||||
if (err) return;
|
||||
parse_keys(data);
|
||||
latex_data.set_citation_keys(keys);
|
||||
})
|
||||
}
|
||||
var buffer = fs.readFileSync(file);
|
||||
parse_keys(buffer);
|
||||
latex_data.set_citation_keys(keys);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,16 +55,8 @@ export function find_label_keys() {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (latex_data.get_label_keys().length == 0) {
|
||||
var buffer = fs.readFileSync(aux_file);
|
||||
parse_keys(buffer);
|
||||
latex_data.set_label_keys(keys);
|
||||
} else {
|
||||
fs.readFile(aux_file, (err, data) => {
|
||||
if (err) return;
|
||||
parse_keys(data);
|
||||
latex_data.set_label_keys(keys);
|
||||
})
|
||||
}
|
||||
var buffer = fs.readFileSync(aux_file);
|
||||
parse_keys(buffer);
|
||||
latex_data.set_label_keys(keys);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user