ํ์์ ์ด๋ฆ: javascript
ctags๋ฅผ ์คํํ๋ ๋ฐ ์ฌ์ฉํ ๋ช ๋ น์ค:
$ ctags --options=NONE Units/parser-javascript.r/js-async2.d/input-more-async.js
์ ๋ ฅ ํ์ผ์ ๋ด์ฉ:
$ cat Units/parser-javascript.r/js-async2.d/input-more-async.js
class ES6Class {
anotherAsyncMethod = async attrs => {}
}
๊ทํ๊ฐ ๋ง์กฑํ์ง ๋ชปํ๋ ํ๊ทธ ์ถ๋ ฅ:
$ cat tags
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
!_TAG_PROGRAM_AUTHOR Universal Ctags Team //
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
!_TAG_PROGRAM_URL https://ctags.io/ /official site/
!_TAG_PROGRAM_VERSION 0.0.0 /00be957/
ES6Class Units/parser-javascript.r/js-async2.d/input-more-async.js /^class ES6Clas
s {$/;" c
์์ํ๋ ํ๊ทธ ์ถ๋ ฅ:
ํ์คํ์ง ์๋ค? ๊ทธ๋ฌ๋ ๊ธฐ๋ณธ์ ์ผ๋ก ์์ด์ง๋ง ๋น๋๊ธฐ ํด๋์ค ๋ฉ์๋์ ๋ํ ํ๊ทธ๊ฐ ์์ต๋๋ค.
ctags ๋ฒ์ :
$ ctags --version
Universal Ctags 0.0.0(00be957), Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
Compiled: Jul 8 2018, 17:27:03
URL: https://ctags.io/
Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +xpath, +case-inse
nsitive-filenames
ctags ๋ฐ์ด๋๋ฆฌ๋ฅผ ์ป๋ ๋ฐฉ๋ฒ: homebrew
์ด ๋ฌธ์ ๋ฅผ ์ง์ ํด๊ฒฐํ๋ ค๊ณ ํ์ง๋ง ํผ์ ์์ํ๊ธฐ์๋ ์ถฉ๋ถํ์ง ์์ต๋๋ค. ์ ์ณ๋๊ณ , ๋๋ ์ปค๋ฎค๋ํฐ ์ฑํ ์ ์ฐพ๊ณ ๋น์ ์ด ๋ฌธ์ ๋ฅผ ์ฌ์ฉํ์ฌ ์์ฌ ์ํตํ๊ณ ์์์ ๊นจ๋ฌ์์ต๋๋ค (๋ฐ๋ผ์์ด ๋ฌธ์ ).
๋ด๊ฐ ์๋ํ ๊ฒ :
$ git diff --cached
diff --git a/Units/parser-javascript.r/js-async2.d/expected.tags b/Units/parser-javascript.r/js
-async2.d/expected.tags
index 18b00b08..8f058db6 100644
--- a/Units/parser-javascript.r/js-async2.d/expected.tags
+++ b/Units/parser-javascript.r/js-async2.d/expected.tags
@@ -7,3 +7,4 @@ method1 input.js /^ method1 : function() {$/;" m class:Class
method2 input.js /^ method2 : async function() {$/;" m class:Class
method3 input.js /^ method3() {$/;" m class:Class
method4 input.js /^ async method4() {$/;" m class:Class
+anotherAsyncMethod input.js /^anotherAsyncMethod = async attrs => {}$/;" m
class:ES6Class
diff --git a/Units/parser-javascript.r/js-async2.d/input-more-async.js b/Units/parser-javascrip
t.r/js-async2.d/input-more-async.js
new file mode 100644
index 00000000..42fcfd36
--- /dev/null
+++ b/Units/parser-javascript.r/js-async2.d/input-more-async.js
@@ -0,0 +1,3 @@
+class ES6Class {
+ anotherAsyncMethod = async attrs => {}
+}
์ ์ณ๋๊ณ , ์ด ์ฝ๋๊ฐ ์ด๋ป๊ฒ ์๋ํ๋์ง์ ๋ํ ๊ธฐ์ฌ๊ฐ ์์ต๋๊น? ์ ๋ ac ๊ฐ๋ฐ์๋ ์๋์ง๋ง js ํ์์ ๋น๋๊ธฐ ํ๊ทธ๋ฅผ ์ถ๊ฐํ ๋ค๋ฅธ PR์ ์กฐ์ฌํ์ ๋ Units/
์ธ๋ถ์ ๋ก์ง์ ๋ํ ๋ง์ ๋ณํ๋ฅผ ๋์น์ฑ์ง ๋ชปํ์ต๋๋ค. expected.tags
ํ์ผ์์ ํ๊ทธ ์ ์๋ฅผ ๋์ถํ๊ธฐ ์ํด ํ๋ง๋ฒ์ ์ฌ์ฉํ๊ณ ์์ต๋๊น? ๋ด๊ฐ ๋์ธ ์์๋ ๋ฐฉ๋ฒ์ ๋ํ ๋์์ด ๋ฉ์ง ๊ฒ์
๋๋ค!
attrs
๋ํ ํ๊ทธ๋ฅผ ์ป์ง ๋ชปํ๋ ์ด์ ๋ async
๊ฐ ์๋๋ผ JS ํ์๊ฐ ํ์ฌ ์ฌ์ฉํ ๋ฉ์๋ ๊ตฌ๋ฌธ์ ์ดํดํ์ง ๋ชปํ๊ธฐ ๋๋ฌธ์
๋๋ค. ์ ๋ ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค๋ง, ์ง์์ ์ถ๊ฐํ๊ธฐ ์ํด ๊ณต๋ถํ๊ณ ๋
ธ๋ ฅํ๊ฒ ์ต๋๋ค.
async
๋ฅผ ์ ๊ฑฐํด๋ ๋ฉ์๋์ ํ๊ทธ๋ฅผ ์ง์ ํ๋ ๋ฐ ๋์์ด ๋์ง ์๋ ๊ฒ์ ํ์ธํ ์ ์์ต๋๋ค.
์ ์ณ๋๊ณ , ์ด ์ฝ๋๊ฐ ์ด๋ป๊ฒ ์๋ํ๋์ง์ ๋ํ ๊ธฐ์ฌ๊ฐ ์์ต๋๊น? ์ ๋ ac ๊ฐ๋ฐ์๋ ์๋์ง๋ง js ํ์์ ๋น๋๊ธฐ ํ๊ทธ๋ฅผ ์ถ๊ฐํ ๋ค๋ฅธ PR์ ์กฐ์ฌํ์ ๋
Units/
์ธ๋ถ์ ๋ก์ง์ ๋ํ ๋ง์ ๋ณํ๋ฅผ ๋์น์ฑ์ง ๋ชปํ์ต๋๋ค.expected.tags
ํ์ผ์์ ํ๊ทธ ์ ์๋ฅผ ๋์ถํ๊ธฐ ์ํด ํ๋ง๋ฒ์ ์ฌ์ฉํ๊ณ ์์ต๋๊น? ๋ด๊ฐ ๋์ธ ์์๋ ๋ฐฉ๋ฒ์ ๋ํ ๋์์ด ๋ฉ์ง ๊ฒ์ ๋๋ค!
๋ถํํ๋ ์ฝ๋ ์์ฒด์ ๋ํ ๋ฌธ์๊ฐ ๋ง์ง ์์ผ๋ฉฐ ๋ช ๊ฐ์ง ์ฃผ์์ด ํฌํจ๋๊ธฐ๋ฅผ ๋ฐ๋๋๋ค. ํ์ง๋ง ์๋์, ํ๋ง๋ฒ์ ๊ทธ๋ ๊ฒ ๋ง์ด ์ฌ์ฉํ์ง๋ ์์ต๋๋ค. async
"support"(41c2c77ea6da1f42fcd891948de04d7b1ad2c958)๋ฅผ ์ถ๊ฐํ ์ปค๋ฐ์ ์ผ๋ถ ์ฝ๋๋ฅผ ์๋ฐ์คํฌ๋ฆฝํธ ํ์์ ์ถ๊ฐํ์ต๋๋ค. async
๋ฅผ ํค์๋๋ก ์ถ๊ฐํ๊ณ ํน๋ณํ 4๊ณณ์์ ์ฒ๋ฆฌํ์ต๋๋ค.
๊ณต์ ํ๊ฒ ๋งํ๋ฉด ๋นํ์ค ๊ตฌ๋ฌธ์ ๋๋ค. ์ ์ /์ธ์คํด์ค ์์ฑ์ ์์ง ํ์ ๋์ง ์์์ต๋๋ค. ๊ทธ๋ฌ๋ ๋๋ ์๋ฌด ๊ฒ๋ ์ถ๊ฐํ์ง ์๊ณ ๋ ์ ๊ฒ ์ถ๊ฐํ๋ ๊ฒ์ด ์ ์ฉํ ๊ฒ์ด๋ผ๊ณ ์๊ฐํฉ๋๋ค.
๋ด๊ฐ ์ธ์ํ์ง ๋ชปํ๋ sap
ํค์๋๋ฅผ ํ์์์ ๋ฐ๊ฒฌํ์ต๋๋ค. @b4n์ ๋ํ ๊ฒ์ ๋ฌด์์
๋๊น? ๋๋ฌด ๊ถ๊ธํ๋ค ๐
๊ณต์ ํ๊ฒ ๋งํ๋ฉด ๋นํ์ค ๊ตฌ๋ฌธ์ ๋๋ค. ์ ์ /์ธ์คํด์ค ์์ฑ์ ์์ง ํ์ ๋์ง ์์์ต๋๋ค. ๊ทธ๋ฌ๋ ๋๋ ์๋ฌด ๊ฒ๋ ์ถ๊ฐํ์ง ์๊ณ ๋ ์ ๊ฒ ์ถ๊ฐํ๋ ๊ฒ์ด ์ ์ฉํ ๊ฒ์ด๋ผ๊ณ ์๊ฐํฉ๋๋ค.
๋นํ์ค ๊ตฌ๋ฌธ์ ๋ํ ์์ธํ ์ ๋ณด๋ ์ด๋์์ ์ป์ ์ ์์ต๋๊น?
LANG=JavaScript
; ์ฐ๋ฆฌ๋ $LANG
์ ๋ฌธ๊ฐ๊ฐ ์๋ u-ctags ๊ฐ๋ฐ์์
๋๋ค. ๊ด๋ จ ์ธ์ด ์ฐธ์กฐ, ํ์ค/๋นํ์ค ์ ๋ณด, ํ์คํ ํํฉ, ์์ ์์ ์
๋ ฅ, ์
๋ ฅ์ ๋ํ ๊ตฌ์ฒด์ ์ธ ์์ ํ๊ทธ ์ถ๋ ฅ,
์ด ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ ๋๊ท๋ชจ ์ฝ๋๋ฒ ์ด์ค์ ์ฌ์ฉ์์ ์ํฅ ๋ฑ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ ๋ฐ ํ์ํฉ๋๋ค.
์ด ์ ๋ณด๋ ME๋ฅผ ๊ตฌ๋ํฉ๋๋ค.
(์ ๋ฌธ์ฅ์ .github/ISSUE_TEMPLATE.md ์ด๋๊ฐ์ ๋ฃ์ด์ผ ํฉ๋๋ค.)
๋ด๊ฐ ์ธ์ํ์ง ๋ชปํ๋ sap ํค์๋๋ฅผ ํ์์์ ๋ฐ๊ฒฌํ์ต๋๋ค. @b4n์ ๋ํ ๊ฒ์ ๋ฌด์์ ๋๊น? ๋ ๋๋ฌด ๊ถ๊ธํด ๋ฏธ์
Universal-ctags๊ฐ ๋ถ๊ธฐ๋ Exuberant-ctags์์ ํค์๋๋ฅผ ์์ํฉ๋๋ค.
๋ด๊ฐ ์ธ์ํ์ง ๋ชปํ๋
sap
ํค์๋๋ฅผ ํ์์์ ๋ฐ๊ฒฌํ์ต๋๋ค. @b4n์ ๋ํ ๊ฒ์ ๋ฌด์์ ๋๊น? ๋๋ฌด ๊ถ๊ธํ๋ค ๐
@masatake๊ฐ ๋งํ๋ฏ์ด, ๊ทธ๊ฒ์ ๋ด ์๋๋ณด๋ค ์์ ๊ฒ์ ๋๋ค :) ํ์ง๋ง ์ด์จ๋ SAPUI5 ํ๋ ์์ํฌ IIUC์ ๋ํ ์ง์์ ๊ฐ์ ํ๊ธฐ ์ํ ์ฌํ ํดํน์ ๋๋ค(์ง๊ธ์ OpenUI5์ธ ๊ฒ์ผ๋ก ๋ณด์ ๋๋ค).
JavaScript ํ์์ OpenUI5 ๋๋ SAPUI5 ํ์ ํ์๋ฅผ ๋์
ํ๊ณ ์ถ์ต๋๋ค.
SAPUI5์ฉ ์๋ฐ์คํฌ๋ฆฝํธ ํ์์ ์ ์๋ ๋ชจ๋ ์ข
๋ฅ๋ ์๋ธํ์๋ก ์ฎ๊ฒจ์ผ ํ๋ค.
@jayceekay , async
์ค๋ช
ํ๋ ๋ฌธ์์ URL ๋๋ ๊ธฐํ ์ ๋ณด๋ฅผ ์๊ณ ์ถ์ต๋๋ค.
๋์ค์ ์ธ ํ์ค์ด ์๋ ๊ฒฝ์ฐ ์๋ธํ์๋ฅผ ๋์ ํ๋ ๋ฐฉ์์ ์๊ฐํ๊ฒ ์ต๋๋ค.
async
set
์์ get
๋๋ set
์์ผ๋ฉด Class
๊ฐ ์ค๋จ๋ฉ๋๋ค. ์๋ ์์ ์ฝ๋๋ฅผ ํ์ธํ์ญ์์ค.
class Test {
async before() { // ctags will recognize this
}
get xx() {
return 1;
}
async after() { // ctags will NOT recognize this
}
set yy(val) {
return 2;
}
async after2() { // ctags will NOT recognize this
}
};
๊ทธ๋ฆฌ๊ณ async
, xx
, yy
๋ฌด๊ดํ ๊ฒ๋ ๋ฌด์ํฉ๋๋ค.
์ฌ์์ฐ๋์ง ์์ต๋๋ค.
[jet@living]/tmp% u-ctags --version
u-ctags --version
Universal Ctags 0.0.0(0730e66d), Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
Compiled: Jul 25 2019, 03:06:32
URL: https://ctags.io/
Optional compiled features: +wildcards, +regex, +iconv, +debug, +option-directory, +xpath, +json, +interactive, +sandbox, +yaml, +aspell, +packcc
[jet@living]/tmp% cat /tmp/foo.js
cat /tmp/foo.js
class Test {
async before() { // ctags will recognize this
}
get xx() {
return 1;
}
async after() { // ctags will NOT recognize this
}
set yy(val) {
return 2;
}
async after2() { // ctags will NOT recognize this
}
};
[jet@living]/tmp% u-ctags -o - /tmp/foo.js
u-ctags -o - /tmp/foo.js
Test /tmp/foo.js /^class Test {$/;" c
after /tmp/foo.js /^ async after() { \/\/ ctags will NOT recognize this$/;" m class:Test
after2 /tmp/foo.js /^ async after2() { \/\/ ctags will NOT recognize this$/;" m class:Test
before /tmp/foo.js /^ async before() { \/\/ ctags will recognize this$/;" m class:Test
xx /tmp/foo.js /^ get xx() {$/;" G class:Test
yy /tmp/foo.js /^ set yy(val) {$/;" S class:Test
[jet@living]/tmp% u-ctags --options=NONE -o - /tmp/foo.js
u-ctags --options=NONE -o - /tmp/foo.js
u-ctags: Notice: No options will be read from files or environment
Test /tmp/foo.js /^class Test {$/;" c
after /tmp/foo.js /^ async after() { \/\/ ctags will NOT recognize this$/;" m class:Test
after2 /tmp/foo.js /^ async after2() { \/\/ ctags will NOT recognize this$/;" m class:Test
before /tmp/foo.js /^ async before() { \/\/ ctags will recognize this$/;" m class:Test
xx /tmp/foo.js /^ get xx() {$/;" G class:Test
yy /tmp/foo.js /^ set yy(val) {$/;" S class:Test
[jet@living]/tmp%
Homebrew universal-ctags ๋ฒ์ ์ด ์ค๋๋์ด ์ง๊ธ๊น์ง ์
๊ทธ๋ ์ด๋ํ ์ ์์ต๋๋ค.
@KazuakiM , @maple-leaf๊ฐ ๋ณด๊ณ ํ Homebrew์ ๋ํ ๋ฌธ์ ๋ฅผ ๋ณผ ์ ์์ต๋๊น?
@๋จํ์
Universal-ctags๋ฅผ ์ ๊ฑฐํ ๋ค์ ์ง๊ธ ๋ค์ ์ค์นํ์ต๋๋ค.
๋๋ brew reinstall universal-ctags
์๋ํ์ญ์์ค.
์ด์ ๋ก๊ทธ)
https://gist.github.com/KazuakiM/69f58a05f07e3f6dd6ea3d76bc977bea
๋ค์ ํ ๋ฒ ๋ง์ํด ์ฃผ์๊ฒ ์ต๋๊น?
@masatake @KazuakiM brew reinstall universal-ctags
์๋ ํ๋๋ฐ ์๋ํฉ๋๋ค. homebrew๊ฐ HEAD ๋ฒ์ ์ ์
๊ทธ๋ ์ด๋ํ ์ ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋ฌธ์ : https://github.com/Homebrew/legacy-homebrew/issues/13197
@๋จํ์
๊ฐ์ฌํฉ๋๋ค. uninstall & install --HEAD
๋ฅผ ์ฌ์ฉํด
$ brew uninstall universal-ctags
$ brew install --HEAD universal-ctags
@KazuakiM ๋ฐฉ๊ธ ์๋ํ๊ณ ์๋ํฉ๋๋ค.