第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用 ReadOnlyPDOMProvider 導入索引內容

使用 ReadOnlyPDOMProvider 導入索引內容

qq_遁去的一_1 2023-07-13 15:46:02
本文介紹如何生成和導入 PDOM 索引。調用生成應用程序后,GeneratePDOM我得到了一個 pdom 文件/home/sadik/eclipse-2019-06/eclipse/pdomExample.pdom。但我導入文件時遇到問題。生成的命令是這樣的: java -jar plugins/org.eclipse.equinox.launcher_1.5.400.v20190515-0925.jar -application "org.eclipse.cdt.core.GeneratePDOM" -target /home/sadik/eclipse-2019-06/eclipse/pdomExample.pdom -source /home/sadik/my-plugin-runtime-2019-06/CDTTest_Local/ -id cdttest_01 -indexer org.eclipse.cdt.core.myfastIndexer請注意target和source參數(shù)。為了測試導入,我編寫了一個實現(xiàn)的類IReadOnlyPDOMProviderpublic class MyReadOnlyPDOMProvider implements IReadOnlyPDOMProvider {    public MyReadOnlyPDOMProvider() {        System.out.println("PDOMProvider");    }    @Override    public boolean providesFor(ICProject project) throws CoreException {        return true;    }    @Override    public IPDOMDescriptor[] getDescriptors(ICConfigurationDescription config) {        final IPath fileBase = Path.fromOSString("/home/sadik/eclipse-2019-06/eclipse/");        final IPath projectBase = Path.fromOSString("/home/sadik/my-plugin-runtime-2019-06/CDTTest_Local/");        return new IPDOMDescriptor[] { new IPDOMDescriptor() {            public IIndexLocationConverter getIndexLocationConverter() {                return new URIRelativeLocationConverter(URIUtil.toURI(projectBase));            }            public IPath getLocation() {                IPath path = fileBase.append("pdomExample.pdom");                return path;            }        }};    }路徑正確嗎?我實際上不知道這里應該返回哪個位置。CIndex我在插件的CDT 擴展點中定義了該類plugin.xml:<extension     point="org.eclipse.cdt.core.CIndex">  <ReadOnlyPDOMProvider        class="de.blub.plugin.MyReadOnlyPDOMProvider">  </ReadOnlyPDOMProvider></extension>當我右鍵單擊testThis()并選擇轉到聲明時,我希望轉到/home/sadik/my-plugin-runtime-2019-06/CDTTest_Local/tests/indexer/declaration.h. 兩個文件位于同一目錄中。但發(fā)生的情況是,打開編輯器時顯示的是一個空文件。編輯器甚至告訴我路徑:/home/soezoguz/rtt-plugin-runtime-2019-06/tests/indexer/declaration.h。路徑缺少項目名稱。所以我猜 pdom 文件存儲的位置位于指定的源目錄下面。我如何告訴 PDOMProvider 查看索引文件的正確目錄?
查看完整描述

1 回答

?
婷婷同學_

TA貢獻1844條經驗 獲得超8個贊

由于某種原因,尾隨的“/”已被省略URIUtil.toURI(...)。但在它的描述中URIRealtiveLocationConverter

注意:提供的基本 URI 必須以正斜杠結尾

因此,我從 String 創(chuàng)建一個 URI 實例,并將“/”附加到該字符串。

@Override

public IPDOMDescriptor[] getDescriptors(ICConfigurationDescription config) {

    final IPath fileBase = Path.fromOSString("/home/sadik/eclipse-2019-06/eclipse/");

    final IPath projectBase = config.getProjectDescription().getProject().getFullPath();

    return new IPDOMDescriptor[] { new IPDOMDescriptor() {

        public IIndexLocationConverter getIndexLocationConverter() {

            URI baseURI;

            try {

                baseURI = new URI(projectBase.toString()+"/");

                return new URIRelativeLocationConverter(baseURI);

            } catch (URISyntaxException e) {

                e.printStackTrace();

            }

            baseURI = URIUtil.toURI(projectBase);

            return new URIRelativeLocationConverter(URIUtil.toURI(projectBase));

        }

        public IPath getLocation() {

            IPath path = fileBase.append("pdomExample.pdom");

            return path;

        }

    }};

}


查看完整回答
反對 回復 2023-07-13
  • 1 回答
  • 0 關注
  • 172 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號