Page MenuHomePhabricator

Truncate long source lines in Paste search result list snippets
ClosedPublic

Authored by gd on Oct 20 2015, 4:30 PM.
Tags
None
Referenced Files
F13078388: D14313.diff
Tue, Apr 23, 3:30 PM
Unknown Object (File)
Fri, Apr 19, 3:47 PM
Unknown Object (File)
Wed, Apr 17, 2:35 PM
Unknown Object (File)
Thu, Apr 11, 9:22 AM
Unknown Object (File)
Wed, Apr 10, 12:18 AM
Unknown Object (File)
Mar 20 2024, 4:46 PM
Unknown Object (File)
Feb 12 2024, 9:08 PM
Unknown Object (File)
Feb 3 2024, 6:54 AM
Subscribers

Details

Summary

An attempt to resolve T9600.

  • PhabricatorPasteQuery builds truncated snippet when requested using needSnippet().
  • PhabricatorPasteSearchEngine uses Paste snippet istead of content.
  • PhabricatorSourceCodeView accepts truncated source and type instead of line limit.
Test Plan

Generated some content for Paste application and also added huge JSON oneliner. Checked Paste application pages in browser.

Diff Detail

Branch
paste-result-list-truncate
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 8361
Build 9595: arc lint + arc unit

Event Timeline

gd retitled this revision from to Truncate long source lines in Paste search result list snippets.
gd updated this object.
gd edited the test plan for this revision. (Show Details)
gd added a reviewer: epriestley.
epriestley edited edge metadata.

Seems reasonable as a step forward to me, thanks! A couple minor inlines. You should have commit access now.

src/applications/paste/query/PhabricatorPasteQuery.php
51

For consistency, prefer needSnippets() over needSnippet() (i.e., plural) -- Query classes load multiple objects in the general case.

292

Prefer phutil_json_decode().

328

Prefer phutil_json_encode().

This revision is now accepted and ready to land.Oct 20 2015, 4:38 PM
This revision was automatically updated to reflect the committed changes.
gd marked 3 inline comments as done.