Skip to content

Commit

Permalink
chore: add dingding qrcode and update readme (#108)
Browse files Browse the repository at this point in the history
* chore: remove travis.yml and update readme.md

* chore: add missing changlog and update version

* chore: update actiona name and readme.md
  • Loading branch information
iChenLei authored Aug 31, 2021
1 parent bbd2610 commit 288c892
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Github actions workflow name
name: VSCode Test
name: CI

# Triggers the workflow on push or pull request events
on: [push, pull_request]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Extension
name: Deploy

on:
push:
Expand Down
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2.3.4 / 2021-09-01
==================

* 添加钉钉用户交流群二维码
* 删除不再使用的travis-ci配置文件

2.3.3 / 2021-08-31
==================

Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
<p align="center"><a href="https://github.com/wx-minapp/minapp-vscode" target="_blank" rel="noopener noreferrer"><img width="100" src="./res/icon.png" alt="wxml language features logo"></a></p>
<img align="right" width="90px" src="https://funimg.pddpic.com/mobile_piggy/0fe81c13-7691-49ae-bb6e-39586d58a1d7.png.slim.png" alt="wxml language features logo" />

## WXML - Language Services
> 插件原名`minapp`,现已更名为`WXML - Language Services`, 未来将持续专注微信原生小程序wxml的支持
[![CI Status](https://github.com/wx-minapp/minapp-vscode/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/wx-minapp/minapp-vscode/actions/workflows/ci.yml?query=branch%3Amaster)
[![Deploy Status](https://github.com/wx-minapp/minapp-vscode/actions/workflows/deploy.yml/badge.svg)](https://github.com/wx-minapp/minapp-vscode/actions/workflows/deploy.yml)
[![Visual Studio Marketplace](https://img.shields.io/visual-studio-marketplace/v/qiu8310.minapp-vscode?color=brightgreen&label=Visual%20Studio%20Marketplace)](https://marketplace.visualstudio.com/items?itemName=qiu8310.minapp-vscode)
![Marketplace Downloads](https://img.shields.io/visual-studio-marketplace/d/qiu8310.minapp-vscode)
![Marketplace Installs](https://img.shields.io/visual-studio-marketplace/i/qiu8310.minapp-vscode)
![Marketplace Rating](https://img.shields.io/visual-studio-marketplace/r/qiu8310.minapp-vscode)
## WXML - Language Services
> 插件原名`minapp`,现已更名为`WXML - Language Services`, 未来将持续专注微信原生小程序wxml的支持

微信小程序.wxml文件代码高亮,标签、属性的智能补全(同时支持原生小程序、mpvue 和 wepy 框架,并提供code snippets)

### 最近更新 【[CHANGELOG.md](https://github.com/wx-minapp/minapp-vscode/blob/master/CHANGELOG.md)
> [@iChenLei](https://github.com/ichenlei)已接手维护本插件,欢迎大家来[issues区](https://github.com/wx-minapp/minapp-vscode/issues)提意见。
> [@iChenLei](https://github.com/ichenlei)已接手维护本插件,欢迎大家在钉钉群或者[Github issues](https://github.com/wx-minapp/minapp-vscode/issues)提意见。
### 用户交流钉钉群

| 用户1群 | 用户2群 | 用户3群 |
| :-----: | :------: | :-----: |
| <img src="https://funimg.pddpic.com/mobile_piggy/548df6a0-47e9-4c8c-99c6-cee4cea53ff2.jpg.slim.c2.jpeg" width="200px" /> | <img src="https://funimg.pddpic.com/mobile_piggy/23c4af30-d384-43cd-8c2e-9252287387aa.jpg.slim.c2.jpeg" width="200px" /> | 暂无 |

> 请使用阿里巴巴旗下[钉钉(DingDing)](https://www.dingtalk.com)APP扫码进入交流群,反馈Bug/给插件维护者提需求,相比Github issues更加接地气地与插件维护者交流。加一个群即可,1群满了试试加2群。如果遇到二维码过期或者群都满了的问题请提[issue](https://github.com/wx-minapp/minapp-vscode/issues)给插件维护者。
### 主要功能

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "minapp-vscode",
"displayName": "WXML - Language Services",
"description": "微信小程序.wxml文件代码高亮,标签、属性的智能补全(同时支持原生小程序、mpvue 和 wepy 框架,并提供code snippets)",
"version": "2.3.3",
"version": "2.3.4",
"publisher": "qiu8310",
"extensionKind": [
"workspace"
Expand Down
14 changes: 7 additions & 7 deletions src/plugin/PropDefinitionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const reserveWords = ['true', 'false']

export class PropDefinitionProvider implements DefinitionProvider {
constructor(public config: Config) {}
public async provideDefinition(document: TextDocument, position: Position, token: CancellationToken) {
public async provideDefinition(document: TextDocument, position: Position, token: CancellationToken): Promise<Location[]> {
const tag = getTagAtPosition(document, position)
const locs: Location[] = []

Expand All @@ -31,26 +31,26 @@ export class PropDefinitionProvider implements DefinitionProvider {
}
} else {
// 判断是否是在 {{ }} 中
let range = document.getWordRangeAtPosition(position, /\{\{[\s\w]+\}\}/)
const range = document.getWordRangeAtPosition(position, /\{\{[\s\w]+\}\}/)
if (!range) return locs
let text = document.getText(range).replace(/^\{\{\s*|\s*\}\}$/g, '')
const text = document.getText(range).replace(/^\{\{\s*|\s*\}\}$/g, '')
return this.searchScript('prop', text, document)
}
return locs
}

searchScript(type: 'prop' | 'method', word: string, doc: TextDocument) {
searchScript(type: 'prop' | 'method', word: string, doc: TextDocument): Location[] {
return getProp(doc.fileName, type, word).map(p => p.loc)
}

searchStyle(className: string, document: TextDocument, position: Position) {
searchStyle(className: string, document: TextDocument, position: Position): Location[] {
const locs: Location[] = []

getClass(document, this.config).forEach(styfile => {
styfile.styles.forEach(sty => {
if (sty.name === className) {
let start = sty.pos
let end = new Position(start.line, 1 + start.character + className.length)
const start = sty.pos
const end = new Position(start.line, 1 + start.character + className.length)
locs.push(new Location(Uri.file(styfile.file), new Range(start, end)))
}
})
Expand Down

0 comments on commit 288c892

Please sign in to comment.