You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

代码搜索:如何排除TypeScript类型定义文件?以createPerformanceMarker为例

The issue here is that Azure DevOps Code Search treats .d.ts files as matching ext:ts (since the final file extension suffix is ts). Using ext:ts NOT ext:d.ts won't work because .d.ts doesn't register as having an extension of d.ts in the search engine's logic—it only looks at the last segment after the final dot.

Here are two reliable ways to exclude .d.ts files while searching for your function:

  1. Combine ext:ts with a filename exclusion
    Use this search query to target .ts files and explicitly exclude any file ending with .d.ts:

    createPerformanceMarker ext:ts AND NOT filename:*.d.ts
    
  2. Directly target non-declaration .ts files
    If you prefer a more concise approach, you can use filename patterns to specify only regular .ts files (excluding .d.ts):

    createPerformanceMarker filename:*.ts NOT filename:*.d.ts
    

Both of these queries leverage the filename: parameter, which lets you match or exclude specific filename patterns—this is the key to distinguishing between regular TypeScript files and type declaration files in Azure DevOps Code Search.

内容的提问来源于stack exchange,提问作者Ondrej Svejdar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.12 05:26:01