prettier / prettier/plugin-php

Cursor jumps to start of file after formatting javascript inside of a php file.

オープン
#2,148 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
PHP
スター
1.9k
フォーク
139
PR マージ指標
30日以内にマージされた PR はありません

説明

prettier version: 2.8.3
Prettier-PHP version: 0.19.3

Steps to reproduce the behavior:

open a .php file with html, php, and a script tag in it
go down to the script tag
save the document
your cursor will jump to the start of the document.

I'm using Sublime, so I'm using the JsPrettier plugin. Here are my JsPrettier settings:

{
	"debug": true,
	"auto_format_on_save": true,
	"additional_cli_args": { "--config-precedence": "file-override" },
	"custom_file_extensions": ["php"],
	"allow_inline_formatting": true,
}

The maintainer of prettier on sublime seems to think it's because the Prettier-PHP plugin isn't following the cursor API.

Anyone else run into this issue? It's super annoying!

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

一覧に記載された Prettier と Prettier-PHP のバージョンを使用して、HTML、PHP、script タグを含む PHP ファイルで問題を再現し、その後、プラグインによる Prettier の formatWithCursor カーソル API の使用を調査します。PHP ファイル内の JavaScript をフォーマットしてもカーソルがドキュメントの先頭に移動しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, php
領域
tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。