Ctags: جافا سكريبت: حصلت على "علامات: تحذير: تجاهل علامة فارغة"

تم إنشاؤها على ٢٥ أبريل ٢٠١٦  ·  18تعليقات  ·  مصدر: universal-ctags/ctags

[yamato@x201]~/var/ctags-github% cat /tmp/foo.js 
if (true) {
    this[0] = function() {};
}

[yamato@x201]~/var/ctags-github% ./ctags -o - /tmp/foo.js 
ctags: Warning: ignoring null tag in /tmp/foo.js(line: 2)
[yamato@x201]~/var/ctags-github% js /tmp/foo.js 
[yamato@x201]~/var/ctags-github%
Parser buenhancement

ال 18 كومينتر

هل هناك أي تحديث على ذلك؟

أم أنني أفعل شيئًا خاطئًا؟ الكود الذي أحاول وضع علامة عليه هو Javascript / React :)

يبدو أنه مرتبط بتدمير الكائنات مثل:

    const { name, email } = user;

لم أفتش التحذير جيدًا.
ومع ذلك ، يبدو الإدخال الذي قدمته صالحًا لأنني اختبرت الإدخال في أمر العقدة
أود أن تفتح عددًا جديدًا للإدخال.
إذا كنت جيدًا في JavaScript ، أود أن أعرف المواصفات كمرجع.
انظر https://github.com/universal-ctags/ctags/issues/1949#issuecomment -457829914 كيف عانيت.

const { name, email } = user;

name و email جيدًا.


[yamato@slave]~% node
> var user = {name: 'a', email: 'b'}
var user = {name: 'a', email: 'b'}
undefined
> const { name, email } = user;
const { name, email } = user;
undefined
> name
name
'a'

إذا كنت جيدًا في JavaScript ، أود أن أعرف المواصفات كمرجع.

لست متأكدًا مما إذا تلقيت سؤالك ولكن مواصفات تدمير الكائن موجودة في مواصفات ECMAScript:
https://www.ecma-international.org/ecma-262/6.0/#sec -destructuring-assignment

:)

شكرا. هذا ما احتاجه.

لماذا لا يتم معالجة هذه القضية؟ لدي نفس المشكلة.

شكرا. هذا ما احتاجه.

كيف أزلت التحذير؟

كيف أزلت التحذير؟

لم أزل التحذير.

كيف أزلت التحذير؟

لم أزل التحذير.

حسنًا ، لدي نفس المشكلة ، يمكن تحليل {A, B} = some_obj بشكل صحيح بواسطة ctags.

يبدو أن لا أحد سيصلح هذه المشكلة

يبدو أن لا أحد سيصلح هذه المشكلة

بالنسبة للربط التدميري ، حاولت مرة واحدة.

[jet@living]/tmp% cd /tmp
cd /tmp
[jet@living]/tmp% git clone https://github.com/masatake/ctags.git
git clone https://github.com/masatake/ctags.git
Cloning into 'ctags'...
...
[jet@living]/tmp% cd ctags
cd ctags
[jet@living]/tmp/ctags% git checkout  origin/js-destructual-binding 
git checkout  origin/js-destructual-binding 
Note: switching to 'origin/js-destructual-binding'.
...
HEAD is now at 4eeac5b9 JavaScript: support more forms of destructuring assignments
[jet@living]/tmp/ctags% bash ./autogen.sh
bash ./autogen.sh
+ type autoreconf
...
optlib2c: translating optlib/inko.ctags to optlib/inko.c
+ ./misc/optlib2c optlib/inko.ctags
+ exit 0
[jet@living]/tmp/ctags% ./configure
./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
...
config.status: creating config.h
config.status: executing depfiles commands
[jet@living]/tmp/ctags% make -j 9
make -j 9
REPOINFO   main/repoinfo.h
make  all-recursive
make[1]: Entering directory '/tmp/ctags'
make[2]: Entering directory '/tmp/ctags'
...
  AR       libctags.a
  CCLD     ctags
  CCLD     mini-geany
make[2]: Leaving directory '/tmp/ctags'
make[1]: Leaving directory '/tmp/ctags'
[jet@living]/tmp/ctags% cat /tmp/bar.js 
cat /tmp/bar.js 
const { name, email } = user;

[jet@living]/tmp/ctags% ./ctags -o - /tmp/bar.js 
./ctags -o - /tmp/bar.js 
email   /tmp/bar.js /^const { name, email } = user;$/;" C
name    /tmp/bar.js /^const { name, email } = user;$/;" C

يقدم الفرع العديد من التغييرات.
لذا فإن دمجها في الفرع الرئيسي الذي نستخدمه يوميًا يحتاج إلى مزيد من الاهتمام.

this[0] = function() {};

في هذه الحالة ، لا تقول ctags شيئًا.

{
    this[0] = function() {};
}

في هذه الحالة ، تلقيت تحذيرًا. سيكون هذا إصلاح تلميح مهم للإدخال الأصلي.

يبدو أن لا أحد سيصلح هذه المشكلة

بالنسبة للربط التدميري ، حاولت مرة واحدة.

[jet@living]/tmp% cd /tmp
cd /tmp
[jet@living]/tmp% git clone https://github.com/masatake/ctags.git
git clone https://github.com/masatake/ctags.git
Cloning into 'ctags'...
...
[jet@living]/tmp% cd ctags
cd ctags
[jet@living]/tmp/ctags% git checkout  origin/js-destructual-binding 
git checkout  origin/js-destructual-binding 
Note: switching to 'origin/js-destructual-binding'.
...
HEAD is now at 4eeac5b9 JavaScript: support more forms of destructuring assignments
[jet@living]/tmp/ctags% bash ./autogen.sh
bash ./autogen.sh
+ type autoreconf
...
optlib2c: translating optlib/inko.ctags to optlib/inko.c
+ ./misc/optlib2c optlib/inko.ctags
+ exit 0
[jet@living]/tmp/ctags% ./configure
./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
...
config.status: creating config.h
config.status: executing depfiles commands
[jet@living]/tmp/ctags% make -j 9
make -j 9
REPOINFO   main/repoinfo.h
make  all-recursive
make[1]: Entering directory '/tmp/ctags'
make[2]: Entering directory '/tmp/ctags'
...
  AR       libctags.a
  CCLD     ctags
  CCLD     mini-geany
make[2]: Leaving directory '/tmp/ctags'
make[1]: Leaving directory '/tmp/ctags'
[jet@living]/tmp/ctags% cat /tmp/bar.js 
cat /tmp/bar.js 
const { name, email } = user;

[jet@living]/tmp/ctags% ./ctags -o - /tmp/bar.js 
./ctags -o - /tmp/bar.js 
email /tmp/bar.js /^const { name, email } = user;$/;" C
name  /tmp/bar.js /^const { name, email } = user;$/;" C

يقدم الفرع العديد من التغييرات.
لذا فإن دمجها في الفرع الرئيسي الذي نستخدمه يوميًا يحتاج إلى مزيد من الاهتمام.

لقد جربته ، حل جيد جدًا ، شكرًا.
هل صنعت هذه الفروع الكثير من البقع.

مرحبا

على الرغم من أن هذا لا يساهم في المشكلة في ctags نفسها ، فقد قمت بإنشاء دالة shell ctags تتجاهل هذا التحذير المحدد لملفات JavaScript: https://gist.github.com/dietrichm/9e518549fd609173182ce36ac4726df2

فقط في حالة تشغيل ctags في سطر الأوامر بشكل متكرر وترغب في إخفاء التحذيرات حتى يتم إصلاح المشكلة.

ديتريش

أحصل أيضًا على هذا التحذير مع إتلاف المصفوفة:
const [lang, setLang] = useState("en")

Strangehill ، هل يمكنك إضافة نفس التعليق إلى # 1112؟

بالتاكيد

شكرا لك.

هل كانت هذه الصفحة مفيدة؟
0 / 5 - 0 التقييمات